コード例 #1
0
        public static MemoryStream Process(ICollectorRegistry registry)
        {
            // leave open
            var stream    = new MemoryStream();
            var collected = registry.CollectAll();

            TextFormatter.Format(stream, collected.ToArray());
            stream.Position = 0;
            return(stream);
        }
コード例 #2
0
 public static void ProcessScrapeRequest(
     IEnumerable <CMetricFamily> collected,
     string contentType,
     Stream outputStream)
 {
     if (contentType == _protoContentType)
     {
         ProtoFormatter.Format(outputStream, collected);
     }
     else
     {
         TextFormatter.Format(outputStream, collected);
     }
 }
コード例 #3
0
        public static void Process(ICollectorRegistry registry, Stream outputStream)
        {
            var collected = registry.CollectAll();

            TextFormatter.Format(outputStream, collected.ToArray());
        }