/// <summary> /// 查询通道监控信息 /// </summary> /// <param name="streamName">通道名称</param> /// <param name="label">通道监控指标</param> /// <param name="startTime">监控开始时间点,10位时间戳</param> /// <param name="endTime">监控结束时间点,10位时间戳</param> /// <returns></returns> public static GetMetricResult GetStreamMetricInfo(string streamName, string label, long startTime, long endTime) { GetMetricResult response = null; var dic = new DISIngestionClient(); var request = new GetStreamMetricRequest { Label = label, StartTime = startTime, EndTime = endTime, }; response = dic.GetStreamMetricInfo(streamName, request); var responseJson = JsonConvert.SerializeObject(response); Console.WriteLine(responseJson); return(response); }
public GetMetricResult GetStreamMetricInfo(string streamName, GetStreamMetricRequest metricRequest) { ObsWebServiceRequest obsWebServiceRequest = new DISWebServiceRequest(); IRequest requestobs = new DISDefaultRequest(obsWebServiceRequest, Constants.SERVICENAME) { HttpMethod = HttpMethodName.GET.ToString() }; var resourcePath = ResourcePathBuilder.Standard() .WithProjectId(_disConfig.GetProjectId()) .WithResource(new StreamResource(null, streamName)) .WithResource(new MetricResource(null)) .Build(); requestobs.ResourcePath = resourcePath; var results = this.Request <GetMetricResult>(metricRequest, requestobs); return(results); }