pub fn encode(registry: &MetricsRegistry) -> Response<Cursor<Vec<u8>>> {
    let metric_families = registry.prometheus_registry().gather();
    let encoder = TextEncoder::default();
    let mut buffer = vec![];
    encoder.encode(&metric_families, &mut buffer).unwrap();

    let mut response = Response::from_data(buffer);
    let content_type = Header::from_bytes(&b"Content-Type"[..], encoder.format_type())
        .expect("Could not parse Content-Type header");
    response.add_header(content_type);

    response
}
/// Encodes the given `MetricsRegistry` as a plaintext `Response`.
Encodes the given `MetricsRegistry` as a plaintext `Response`.
Encodes the given ` MetricsRegistry ` as a plaintext ` Response ` .
pub fn encode(registry: &MetricsRegistry) -> Response<Cursor<Vec<u8>>> {
    let metric_families = registry.prometheus_registry().gather();
    let encoder = TextEncoder::default();
    let mut buffer = vec![];
    encoder.encode(&metric_families, &mut buffer).unwrap();
    let mut response = Response::from_data(buffer);
    let content_type = Header::from_bytes(&b"Content-Type"[..], encoder.format_type())
        .expect("Could not parse Content-Type header");
    response.add_header(content_type);
    response
}
pub fn encode ( registry : & MetricsRegistry ) -> Response < Cursor < Vec < u8 > > > { let metric_families = registry . prometheus_registry ( ) . gather ( ) ; let encoder = TextEncoder :: default ( ) ; let mut buffer = vec ! [ ] ; encoder . encode ( & metric_families , & mut buffer ) . unwrap ( ) ; let mut response = Response :: from_data ( buffer ) ; let content_type = Header :: from_bytes ( & b" " [ .. ] , encoder . format_type ( ) ) . expect ( " " ) ; response . add_header ( content_type ) ; response }
Encodes the given `MetricsRegistry` as a plaintext `Response`.
Encodes the given ` MetricsRegistry ` as a plaintext ` Response ` .
registry
&MetricsRegistry
registry
&MetricsRegistry