@ Override public void onCycleComplete ( com . netflix . hollow . api . producer . Status status , HollowProducer . ReadState readState , long version , Duration elapsed ) { boolean isCycleSuccess ; long cycleEndTimeNano = System . nanoTime ( ) ; if ( status . getType ( ) == com . netflix . hollow . api . producer . Status . StatusType . SUCCESS ) { isCycleSuccess = true ; consecutiveFailures = 0l ; lastCycleSuccessTimeNanoOptional = OptionalLong . of ( cycleEndTimeNano ) ; } else { isCycleSuccess = false ; consecutiveFailures ++ ; } cycleMetricsBuilder . setConsecutiveFailures ( consecutiveFailures ) . setCycleDurationMillis ( elapsed . toMillis ( ) ) . setIsCycleSuccess ( isCycleSuccess ) ; lastCycleSuccessTimeNanoOptional . ifPresent ( cycleMetricsBuilder :: setLastCycleSuccessTimeNano ) ; cycleMetricsReporting ( cycleMetricsBuilder . build ( ) ) ; }
On cycle completion this method reports cycle metrics .