Class StatsInfo
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.stat.StatsInfo
Provides access to starts collected at startup.
Instance bound to guice context and available for injection.
Prefer using through
GuiceyConfigurationInfo.getStats().- Since:
- 28.07.2016
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDetailedStats(DetailStat stat) Detailed stats used to track duration for exact entity (command or guicey bundle).Value is reported in best suited units (e.g. milliseconds, seconds, minutes etc).longNote: time stats are measured in nanoseconds and after conversion to millisecond it may become 0.
-
Constructor Details
-
StatsInfo
Create info.- Parameters:
tracker- tracker
-
-
Method Details
-
time
Note: time stats are measured in nanoseconds and after conversion to millisecond it may become 0. Usually it makes no sense to log such small values, and 0 value makes it easier to filter out them. In contrast, when usinghumanTime(Stat)for such timers, correct value will be printed.- Parameters:
name- statistic name- Returns:
- collected time in milliseconds or 0 (if stat value is not available)
- Throws:
IllegalStateException- if provided stat is not time stat
-
duration
- Parameters:
name- statistic name- Returns:
- collected time duration or 0 (if stat value is not available)
- Throws:
IllegalStateException- if provided stat is not time stat
-
humanTime
Value is reported in best suited units (e.g. milliseconds, seconds, minutes etc).- Parameters:
name- statistic name- Returns:
- human readable (formatted) timer value or 0 (if stat value is not available)
- Throws:
IllegalStateException- if provided stat is not time stat
-
count
- Parameters:
name- statistic name- Returns:
- stat value or 0 (if stat value is not available)
- Throws:
IllegalStateException- if provided stat is not count stat
-
getGuiceStats
- Returns:
- guice injector creation logs (intercepted)
-
getDetailedStats
Detailed stats used to track duration for exact entity (command or guicey bundle).- Parameters:
stat- required stat- Returns:
- all collected detailed stats of type
-