Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonGenerator.writeEndObject()


                    writeSampling(timer, json);
                    if (context.showFullSamples) {
                        json.writeObjectField("values", timer.getSnapshot().getValues());
                    }
                }
                json.writeEndObject();

                json.writeFieldName("rate");
                json.writeStartObject();
                {
                    writeMeteredFields(timer, json);
View Full Code Here


                json.writeFieldName("rate");
                json.writeStartObject();
                {
                    writeMeteredFields(timer, json);
                }
                json.writeEndObject();
            }
            json.writeEndObject();
        }

        @Override
View Full Code Here

                {
                    writeMeteredFields(timer, json);
                }
                json.writeEndObject();
            }
            json.writeEndObject();
        }

        @Override
        public void processGauge(MetricName name, Gauge<?> gauge, Context context) throws Exception {
            final JsonGenerator json = context.json;
View Full Code Here

            json.writeStartObject();
            {
                json.writeStringField("type", "gauge");
                json.writeObjectField("value", evaluateGauge(gauge));
            }
            json.writeEndObject();
        }

        private static void writeSummarizable(Summarizable metric, JsonGenerator json) throws IOException {
            json.writeNumberField("min", metric.min());
            json.writeNumberField("max", metric.max());
View Full Code Here

            }

            ServerMetrics metricProcessor = new ServerMetrics();
            writeRegularMetrics(json, classPrefix, metricProcessor);
        }
        json.writeEndObject();
        json.close();

        return ok(writer.toString());
    }
View Full Code Here

            {
                json.writeStringField("type", "meter");
                json.writeStringField("event_type", meter.eventType());
                writeMeteredFields(meter, json);
            }
            json.writeEndObject();
        }

        @Override
        public void processCounter(MetricName name, Counter counter, Context context) throws Exception {
            final JsonGenerator json = context.json;
View Full Code Here

            json.writeStartObject();
            {
                json.writeStringField("type", "counter");
                json.writeNumberField("count", counter.count());
            }
            json.writeEndObject();
        }

        @Override
        public void processHistogram(MetricName name, Histogram histogram, Context context) throws Exception {
            final JsonGenerator json = context.json;
View Full Code Here

                if (context.showFullSamples) {
                    json.writeObjectField("values", histogram.getSnapshot().getValues());
                }
            }
            json.writeEndObject();
        }

        private static Object evaluateGauge(Gauge<?> gauge) {
            try {
                return gauge.value();
View Full Code Here

      public void visit(MetricTreeObject o) {
        try {
          writeKey(o);
          jsonGenerator.writeStartObject();
          o.visitChildren(this);
          jsonGenerator.writeEndObject();
        } catch (IOException e) {
          throw new IllegalStateException("Error serializing to JSON", e);
        }
      }
View Full Code Here

    // wrap in an object to form proper json
    generator.writeStartObject();

    hstore.jsonWrite(generator, "key", map);

    generator.writeEndObject();
    generator.flush();

    return writer.toString();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.