Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47 committed May 8, 2017
1 parent 807f0bc commit 6983e4f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ Or just this:

```csharp

[Route("[controller]")]
public class MetricsController: Controller
[HttpGet]
public IActionResult Get()
{
[HttpGet]
public IActionResult Get()
var registry = CollectorRegistry.Instance;
var acceptHeaders = Request.Headers["Accept"];
var contentType = ScrapeHandler.GetContentType(acceptHeaders);
Response.ContentType = contentType;
string content;

using (var outputStream = new MemoryStream())
{
var registry = CollectorRegistry.Instance;
var acceptHeaders = Request.Headers["Accept"];
var contentType = ScrapeHandler.GetContentType(acceptHeaders);
Response.ContentType = contentType;
var s = ScrapeHandler.ProcessScrapeRequest(registry.CollectAll(), contentType);
return new OkObjectResult(s);
var collected = registry.CollectAll();
ScrapeHandler.ProcessScrapeRequest(collected, contentType, outputStream);
content = Encoding.UTF8.GetString(outputStream.ToArray());
}

return Ok(content);
}

```
Expand Down

0 comments on commit 6983e4f

Please sign in to comment.