/** * Create a new updater object with some overrides (used in unit tests). * @param instrumentation The metrics source to update. * @param windowSizeMs The window size to use for calculating bandwidth * (in milliseconds). * @param manualUpdateTrigger If true, then this object won't create the * auto-update threads, and will wait for manual * calls to triggerUpdate to occur. */ public BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation, int windowSizeMs, boolean manualUpdateTrigger) { this.windowSizeMs = windowSizeMs; this.instrumentation = instrumentation; if (!manualUpdateTrigger) { uploadBandwidthUpdater = new Thread(new UploadBandwidthUpdater(), THREAD_NAME); uploadBandwidthUpdater.setDaemon(true); uploadBandwidthUpdater.start(); } }
/** * Create a new updater object with some overrides (used in unit tests). * @param instrumentation The metrics source to update. * @param windowSizeMs The window size to use for calculating bandwidth * (in milliseconds). * @param manualUpdateTrigger If true, then this object won't create the * auto-update threads, and will wait for manual * calls to triggerUpdate to occur. */ public BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation, int windowSizeMs, boolean manualUpdateTrigger) { this.windowSizeMs = windowSizeMs; this.instrumentation = instrumentation; if (!manualUpdateTrigger) { uploadBandwidthUpdater = new Thread(new UploadBandwidthUpdater(), THREAD_NAME); uploadBandwidthUpdater.setDaemon(true); uploadBandwidthUpdater.start(); } }