src/main/java/org/apache/hadoop/hdfs/server/namenode/queries/Histograms.java
public static String toJson(Object set) {
    long s1 = System.currentTimeMillis();
    String gson = new Gson().toJson(set);
    long e1 = System.currentTimeMillis();
    LOG.debug("Time to convert object to JSON of {} chars took: {} ms.", gson.length(), (e1 - s1));
    return gson;
  }
/**
   * Converts given set of values to JSON String.
   *
   * @param set set of values to be converted to json
   * @return json string
   */
Converts given set of values to JSON String.
@param set set of values to be converted to json
@return json string
Converts given set of values to JSON String . @param set set of values to be converted to json @return json string
public static String toJson(Object set) {
    long s1 = System.currentTimeMillis();
    String gson = new Gson().toJson(set);
    long e1 = System.currentTimeMillis();
    LOG.debug("Time to convert object to JSON of {} chars took: {} ms.", gson.length(), (e1 - s1));
    return gson;
  }
public static String toJson ( Object set ) { long s1 = System . currentTimeMillis ( ) ; String gson = new Gson ( ) . toJson ( set ) ; long e1 = System . currentTimeMillis ( ) ; LOG . debug ( "Time to convert object to JSON of {} chars took: {} ms." , gson . length ( ) , ( e1 - s1 ) ) ; return gson ; }
Converts given set of values to JSON String.
Converts given set of values to JSON String .