Package com.fasterxml.jackson.core

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


    json.writeNumberField("90", commandMetrics.getTotalTimePercentile(90));
    json.writeNumberField("95", commandMetrics.getTotalTimePercentile(95));
    json.writeNumberField("99", commandMetrics.getTotalTimePercentile(99));
    json.writeNumberField("99.5", commandMetrics.getTotalTimePercentile(99.5));
    json.writeNumberField("100", commandMetrics.getTotalTimePercentile(100));
    json.writeEndObject();

    // property values for reporting what is actually seen by the command rather than what was set somewhere
    HystrixCommandProperties commandProperties = commandMetrics.getProperties();

    json.writeNumberField("propertyValue_circuitBreakerRequestVolumeThreshold", commandProperties.circuitBreakerRequestVolumeThreshold().get());
View Full Code Here


    json.writeBooleanField("propertyValue_requestCacheEnabled", commandProperties.requestCacheEnabled().get());
    json.writeBooleanField("propertyValue_requestLogEnabled", commandProperties.requestLogEnabled().get());

    json.writeNumberField("reportingHosts", 1); // this will get summed across all instances in a cluster

    json.writeEndObject();
    json.close();

    return jsonString.getBuffer().toString();
  }
View Full Code Here

    json.writeNumberField("rollingCountThreadsExecuted", threadPoolMetrics.getRollingCountThreadsExecuted());
    json.writeNumberField("rollingMaxActiveThreads", threadPoolMetrics.getRollingMaxActiveThreads());
    json.writeNumberField("propertyValue_queueSizeRejectionThreshold", threadPoolMetrics.getProperties().queueSizeRejectionThreshold().get());
    json.writeNumberField("propertyValue_metricsRollingStatisticalWindowInMilliseconds", threadPoolMetrics.getProperties().metricsRollingStatisticalWindowInMilliseconds().get());
    json.writeNumberField("reportingHosts", 1); // this will get summed across all instances in a cluster
    json.writeEndObject();
    json.close();

    return jsonString.getBuffer().toString();
  }
View Full Code Here

    private static String buildJsonBody(String key, String value) throws IOException {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator jsonGenerator = JsonUtils.createJsonGenerator(stringWriter);
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField(key, value);
        jsonGenerator.writeEndObject();
        jsonGenerator.flush();
        jsonGenerator.close();
        return stringWriter.toString();
    }
View Full Code Here

                    for (String value : entry.getValue())
                        jg.writeString(value);
                    if (entry.getValue().size() != 1)
                        jg.writeEndArray();
                }
                jg.writeEndObject();
                jg.close();
                json = str.toString();
            }
            catch (IOException ex) {
                throw new AkibanInternalException("Error writing to string", ex);
View Full Code Here

                                generator.writeString(URLDecoder.decode(value, "UTF-8"));
                            }
                            generator.writeEndArray();
                        }
                    }
                    generator.writeEndObject();
                    generator.close();

                } catch (Exception ex) {
                    response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR);
                }
View Full Code Here

        gen.writeStringField("index", "test");

        gen.writeFieldName("source");
        gen.writeStartObject();
        gen.writeStringField("value", "something");
        gen.writeEndObject();

        gen.writeEndObject();

        gen.close();
View Full Code Here

        gen.writeFieldName("source");
        gen.writeStartObject();
        gen.writeStringField("value", "something");
        gen.writeEndObject();

        gen.writeEndObject();

        gen.close();

        byte[] data = os.bytes().toBytes();
        JsonParser parser = new JsonFactory().createParser(data);
View Full Code Here

            } else if (value instanceof Float) {
              g.writeNumberField("value", (Float) value);
            } else if (value instanceof Double) {
              g.writeNumberField("value", (Double) value);
            }
            g.writeEndObject();
          }
        }
      }
    }
    g.writeEndArray();
View Full Code Here

          }
        }
      }
    }
    g.writeEndArray();
    g.writeEndObject();
    g.flush();
    g.close();

  }
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.