public void DashboardMetric_Returns_Value(DashboardMetric dashboardMetric) { var page = new TestPage(); var metric = dashboardMetric.Func(page); Assert.NotEqual("???", metric.Value); }
public override void Execute() { WriteLiteral("\r\n"); #line 4 "..\..\Dashboard\Pages\_InlineMetric.cshtml" var metric = DashboardMetric.Func(this); var className = metric == null ? "metric-null" : metric.Style.ToClassName(); var highlighted = metric != null && metric.Highlighted ? "highlighted" : null; #line default #line hidden WriteLiteral("<span data-metric=\""); #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml" Write(DashboardMetric.Name); #line default #line hidden WriteLiteral("\" class=\"metric "); #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml" Write(className); #line default #line hidden WriteLiteral(" "); #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml" Write(highlighted); #line default #line hidden WriteLiteral("\">"); #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml" Write(metric?.Value); #line default #line hidden WriteLiteral("</span>"); }
public ActionResult GetMetricSpecificSettings(MetricType metricType) { var m = new DashboardMetric { ChartScope = MetricChartScope.TopTen, FuzzyDateType = FuzzyDateType.TwoWeeksAgo }; return(Json(new DashboardMetricSpecificSettingsViewModel { ChartScope = m.ChartScope.ToString("d"), FuzzyDateType = m.FuzzyDateType.ToString("d") }, JsonRequestBehavior.AllowGet)); }
public static IGlobalConfiguration UseDashboardMetric( [NotNull] this IGlobalConfiguration configuration, [NotNull] DashboardMetric metric) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (metric == null) { throw new ArgumentNullException("metric"); } DashboardMetrics.AddMetric(metric); HomePage.Metrics.Add(metric); return(configuration); }
public void GetInfo_Threaded() { DashboardMetric Result1 = null; DashboardMetric Result2 = null; var t = new Thread(() => Result1 = Redis.Storage.GetDashboardInfo("Version", "redis_version")); var t2 = new Thread(() => Result2 = Redis.Storage.GetDashboardInfo("Blocked Clients", "blocked_clients")); t.IsBackground = true; t2.IsBackground = true; t.Start(); t2.Start(); t.Join(); t2.Join(); Assert.Equal("2.8.19", Result1.Func(null).Value); Assert.Equal("0", Result2.Func(null).Value); }
public override void Execute() { WriteLiteral("\r\n"); #line 5 "..\..\Dashboard\Pages\_BlockMetric.cshtml" var metric = DashboardMetric.Func(this); var className = metric == null ? "metric-null" : metric.Style.ToClassName(); var highlighted = metric != null && metric.Highlighted ? "highlighted" : null; #line default #line hidden WriteLiteral("<div class=\"metric "); #line 10 "..\..\Dashboard\Pages\_BlockMetric.cshtml" Write(className); #line default #line hidden WriteLiteral(" "); #line 10 "..\..\Dashboard\Pages\_BlockMetric.cshtml" Write(highlighted); #line default #line hidden WriteLiteral("\">\r\n <div class=\"metric-body\" data-metric=\""); #line 11 "..\..\Dashboard\Pages\_BlockMetric.cshtml" Write(DashboardMetric.Name); #line default #line hidden WriteLiteral("\">\r\n "); #line 12 "..\..\Dashboard\Pages\_BlockMetric.cshtml" Write(metric?.Value); #line default #line hidden WriteLiteral("\r\n </div>\r\n <div class=\"metric-description\">\r\n "); #line 15 "..\..\Dashboard\Pages\_BlockMetric.cshtml" Write(Strings.ResourceManager.GetString(DashboardMetric.Title) ?? DashboardMetric.Title); #line default #line hidden WriteLiteral("\r\n </div>\r\n</div>"); }
public BlockMetric(DashboardMetric dashboardMetric) { DashboardMetric = dashboardMetric; }
public InlineMetric(DashboardMetric dashboardMetric) { DashboardMetric = dashboardMetric; }
public BlockMetric(DashboardMetric dashboardMetric) { DashboardMetric = dashboardMetric; }
public ActionResult GetMetricSettings(int id) { Thread.Sleep(1000); //get this from db var m = new DashboardMetric { DashboardId = 1, MetricType = MetricType.AverageSpeed, ChartScope = MetricChartScope.TopFifty, StatType = MetricStatType.AveragePerVehicle, ChartType = MetricChartType.Rank, FuzzyDateType = FuzzyDateType.LastWeek }; var mt = new List <ListItem>(); foreach (MetricType enumValue in Enum.GetValues(typeof(MetricType))) { mt.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var cs = new List <ListItem>(); foreach (MetricChartScope enumValue in Enum.GetValues(typeof(MetricChartScope))) { cs.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var st = new List <ListItem>(); foreach (MetricStatType enumValue in Enum.GetValues(typeof(MetricStatType))) { st.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var ct = new List <ListItem>(); foreach (MetricChartType enumValue in Enum.GetValues(typeof(MetricChartType))) { ct.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var me = new List <ListItem>(); foreach (MetricEntityType enumValue in Enum.GetValues(typeof(MetricEntityType))) { me.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var fd = new List <ListItem>(); foreach (FuzzyDateType enumValue in Enum.GetValues(typeof(FuzzyDateType))) { fd.Add(new ListItem(enumValue.ToString(), enumValue.ToString("d"))); } var model = new DashboardMetricSettingsViewModel { DashboardId = id, MetricId = m.MetricId, MetricType = m.MetricType.ToString("d"), ChartType = m.ChartType.ToString("d"), ChartScope = m.ChartScope.ToString("d"), EntityType = m.EntityType.ToString("d"), StatType = m.StatType.ToString("d"), FuzzyDateType = m.FuzzyDateType.ToString("d"), MetricTypes = mt, ChartScopes = cs, StatTypes = st, ChartTypes = ct, FuzzyDateTypes = fd, EntityTypes = me }; return(Json(model, JsonRequestBehavior.AllowGet)); }
public InlineMetric(DashboardMetric dashboardMetric) { DashboardMetric = dashboardMetric; }