Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void init() throws java.io.IOException
        public override void Init()
        {
            // Setup CSV reporting
            File configuredPath = _config.get(csvPath);

            if (configuredPath == null)
            {
                throw new System.ArgumentException(csvPath.name() + " configuration is required since " + csvEnabled.name() + " is enabled");
            }
            long?rotationThreshold = _config.get(MetricsSettings.csvRotationThreshold);
            int? maxArchives       = _config.get(MetricsSettings.csvMaxArchives);

            _outputPath  = AbsoluteFileOrRelativeTo(_kernelContext.directory(), configuredPath);
            _csvReporter = RotatableCsvReporter.ForRegistry(_registry).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).formatFor(Locale.US).outputStreamSupplierFactory(GetFileRotatingFileOutputStreamSupplier(rotationThreshold, maxArchives)).build(EnsureDirectoryExists(_outputPath));
        }