public static CostResultRows Cast(dynamic columns, dynamic singleRow)
        {
            var parsedRow = new CostResultRows();

            parsedRow.Values.AddRange(ClearParse(singleRow.ToString()));

            foreach (var column in columns)
            {
                parsedRow.ColumnNames.Add(column.name.ToString());
            }

            return(parsedRow);
        }
Пример #2
0
        public void SetValues(MetricConfig key, CostResultRows customData)
        {
            var gauge = CustomGaugeMetrics[key];

            var labelValues = new List <string>();

            labelValues.AddRange(key.StaticLabel.Select(x => x.Value));
            foreach (var keyLabel in key.KeyLabels)
            {
                var dataColumnByKeyLabel = customData.GetByColumnName(keyLabel);

                if (key.ReplaceDateLabelsToEnum)
                {
                    dataColumnByKeyLabel = DateEnumHelper.ReplaceDateValueToEnums(dataColumnByKeyLabel);
                }
                labelValues.Add(dataColumnByKeyLabel);
            }

            gauge
            .WithLabels(labelValues.ToArray())
            .Set(customData.GetValueByColumnName(key.Value));
        }