HistogramLogWriter.d.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import Histogram from "./Histogram";
  2. export interface Writable {
  3. (c: string): void;
  4. }
  5. declare class HistogramLogWriter {
  6. private log;
  7. /**
  8. * Base time to subtract from supplied histogram start/end timestamps when
  9. * logging based on histogram timestamps.
  10. * Base time is expected to be in msec since the epoch, as histogram start/end times
  11. * are typically stamped with absolute times in msec since the epoch.
  12. */
  13. baseTime: number;
  14. constructor(log: Writable);
  15. /**
  16. * Output an interval histogram, with the given timestamp information and the [optional] tag
  17. * associated with the histogram, using a configurable maxValueUnitRatio. (note that the
  18. * specified timestamp information will be used, and the timestamp information in the actual
  19. * histogram will be ignored).
  20. * The max value reported with the interval line will be scaled by the given maxValueUnitRatio.
  21. * @param startTimeStampSec The start timestamp to log with the interval histogram, in seconds.
  22. * @param endTimeStampSec The end timestamp to log with the interval histogram, in seconds.
  23. * @param histogram The interval histogram to log.
  24. * @param maxValueUnitRatio The ratio by which to divide the histogram's max value when reporting on it.
  25. */
  26. outputIntervalHistogram(histogram: Histogram, startTimeStampSec?: number, endTimeStampSec?: number, maxValueUnitRatio?: number): void;
  27. /**
  28. * Log a comment to the log.
  29. * Comments will be preceded with with the '#' character.
  30. * @param comment the comment string.
  31. */
  32. outputComment(comment: string): void;
  33. /**
  34. * Log a start time in the log.
  35. * @param startTimeMsec time (in milliseconds) since the absolute start time (the epoch)
  36. */
  37. outputStartTime(startTimeMsec: number): void;
  38. /**
  39. * Output a legend line to the log.
  40. */
  41. outputLegend(): void;
  42. /**
  43. * Output a log format version to the log.
  44. */
  45. outputLogFormatVersion(): void;
  46. }
  47. export default HistogramLogWriter;