Ejemplo n.º 1
0
        public MetricResults metrics()
        {
            var metrics = new MetricResults();
            var start   = DateTime.Now;

            each(collectors, (portfolio, collector) => metrics[portfolio.name] = collector.metrics());
            var seconds = (DateTime.Now - start).TotalSeconds;

            LogC.info("metric calculation took " + seconds + " seconds (" + (collectors.Count / seconds) + " collectors per second)");
            return(metrics);
        }
Ejemplo n.º 2
0
        public void testCanWriteToS3()
        {
            var id = 5203;

            new MetaBucket("quantys-5203").create();
            var metrics    = new MetricResults();
            var marketName = "RE.TEST.TY.1C";
            var runNumber  = 1;
            var expected   = new Dictionary <string, double> {
                { "value1", 1.0 },
                { "value2", 5.005 },
                { "value3", 0.005 }
            };

            metrics.Add(marketName, expected);
            metrics.Add(marketName + ".2", expected);
            MetricFiles.writeToS3(id, runNumber, metrics);
            var actual = MetricFiles.readFromS3(id, runNumber);

            IsTrue(Objects.dictionaryEquals(expected, actual[marketName]));
            IsTrue(Objects.dictionaryEquals(expected, actual[marketName + ".2"]));
        }
Ejemplo n.º 3
0
 public static void writeToS3(int id, int number, MetricResults metrics)
 {
     key(id, number).write(metrics.java());
 }