예제 #1
0
        public void writeSTOFiles(bool doMetricFiles)
        {
            each(collectors, (portfolio, collector) => collector.writeSTOFiles(portfolio.name, doMetricFiles));
            if (!doMetricFiles || !arguments.parameters.isCloudSTO())
            {
                return;
            }

            var systemId = arguments.systemId();
            var run      = arguments.parameters.runNumber();

            MetricFiles.writeToS3(systemId, run, metrics());
            FetchSTOParameters.key(systemId, run).write(serialize(arguments.parameters));
        }
예제 #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"]));
        }