test_class.file: ui/src/test/java/org/glowroot/ui/TraceCommonServiceTest.java
test_class.identifier: TraceCommonServiceTest
test_case.body: @Test
      public void test() throws Exception {
          // given
          List<Trace.Entry> entries = Lists.newArrayList();
          entries.add(Trace.Entry.newBuilder().setDepth(0).build());
          entries.add(Trace.Entry.newBuilder().setDepth(1).build());
          // when
          String json = TraceCommonService.entriesToJson(entries);
          // then
          assertThat(json).isEqualTo("[{\"startOffsetNanos\":0,\"durationNanos\":0,\"message\":\"\","
                  + "\"childEntries\":[{\"startOffsetNanos\":0,\"durationNanos\":0,\"message\":\"\"}]"
                  + "}]");
      }
test_case.class_method_signature: TraceCommonServiceTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: newArrayList add build setDepth newBuilder add build setDepth newBuilder entriesToJson isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: jsonFactory = new JsonFactory()
focal_class.modifier: private static final
focal_class.original_string: private static final JsonFactory jsonFactory = new JsonFactory();
focal_class.type: JsonFactory
focal_class.var_name: jsonFactory
focal_class.declarator: traceRepository
focal_class.modifier: private final
focal_class.original_string: private final TraceRepository traceRepository;
focal_class.type: TraceRepository
focal_class.var_name: traceRepository
focal_class.declarator: liveTraceRepository
focal_class.modifier: private final
focal_class.original_string: private final LiveTraceRepository liveTraceRepository;
focal_class.type: LiveTraceRepository
focal_class.var_name: liveTraceRepository
focal_class.declarator: agentDisplayRepository
focal_class.modifier: private final
focal_class.original_string: private final AgentDisplayRepository agentDisplayRepository;
focal_class.type: AgentDisplayRepository
focal_class.var_name: agentDisplayRepository
focal_class.file: ui/src/main/java/org/glowroot/ui/TraceCommonService.java
focal_class.identifier: TraceCommonService
focal_class.class_method_signature: TraceCommonService.TraceCommonService(TraceRepository traceRepository, LiveTraceRepository liveTraceRepository,
              AgentDisplayRepository agentDisplayRepository)
focal_class.full_signature:   TraceCommonService(TraceRepository traceRepository, LiveTraceRepository liveTraceRepository,
              AgentDisplayRepository agentDisplayRepository)
focal_class.identifier: TraceCommonService
focal_class.parameters: (TraceRepository traceRepository, LiveTraceRepository liveTraceRepository,
              AgentDisplayRepository agentDisplayRepository)
focal_class.signature:  TraceCommonService(TraceRepository traceRepository, LiveTraceRepository liveTraceRepository,
              AgentDisplayRepository agentDisplayRepository)
focal_class.class_method_signature: TraceCommonService.getHeaderJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable String getHeaderJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getHeaderJson
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: String
focal_class.signature: String getHeaderJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getEntriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable String getEntriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getEntriesJson
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: String
focal_class.signature: String getEntriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getQueriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable String getQueriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getQueriesJson
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: String
focal_class.signature: String getQueriesJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getMainThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable String getMainThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getMainThreadProfileJson
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: String
focal_class.signature: String getMainThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getAuxThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable String getAuxThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getAuxThreadProfileJson
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: String
focal_class.signature: String getAuxThreadProfileJson(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getMainThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable Profile getMainThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getMainThreadProfile
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: Profile
focal_class.signature: Profile getMainThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getAuxThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable Profile getAuxThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getAuxThreadProfile
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: Profile
focal_class.signature: Profile getAuxThreadProfile(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getExport(String agentId, String traceId, boolean checkLiveTraces)
focal_class.full_signature: @Nullable TraceExport getExport(String agentId, String traceId, boolean checkLiveTraces)
focal_class.identifier: getExport
focal_class.modifiers: @Nullable
focal_class.parameters: (String agentId, String traceId, boolean checkLiveTraces)
focal_class.return: TraceExport
focal_class.signature: TraceExport getExport(String agentId, String traceId, boolean checkLiveTraces)
focal_class.class_method_signature: TraceCommonService.getStoredHeader(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable HeaderPlus getStoredHeader(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.identifier: getStoredHeader
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.return: HeaderPlus
focal_class.signature: HeaderPlus getStoredHeader(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.getStoredEntries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable Entries getStoredEntries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.identifier: getStoredEntries
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.return: Entries
focal_class.signature: Entries getStoredEntries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.getStoredQueries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable Queries getStoredQueries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.identifier: getStoredQueries
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.return: Queries
focal_class.signature: Queries getStoredQueries(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.getStoredEntriesAndQueriesForExport(String agentId,
              String traceId, RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable EntriesAndQueries getStoredEntriesAndQueriesForExport(String agentId,
              String traceId, RetryCountdown retryCountdown)
focal_class.identifier: getStoredEntriesAndQueriesForExport
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId,
              String traceId, RetryCountdown retryCountdown)
focal_class.return: EntriesAndQueries
focal_class.signature: EntriesAndQueries getStoredEntriesAndQueriesForExport(String agentId,
              String traceId, RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.getStoredMainThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable Profile getStoredMainThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.identifier: getStoredMainThreadProfile
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.return: Profile
focal_class.signature: Profile getStoredMainThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.getStoredAuxThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.full_signature: private @Nullable Profile getStoredAuxThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.identifier: getStoredAuxThreadProfile
focal_class.modifiers: private @Nullable
focal_class.parameters: (String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.return: Profile
focal_class.signature: Profile getStoredAuxThreadProfile(String agentId, String traceId,
              RetryCountdown retryCountdown)
focal_class.class_method_signature: TraceCommonService.toJson(@Nullable Entries entries)
focal_class.full_signature: private static @Nullable String toJson(@Nullable Entries entries)
focal_class.identifier: toJson
focal_class.modifiers: private static @Nullable
focal_class.parameters: (@Nullable Entries entries)
focal_class.return: String
focal_class.signature: String toJson(@Nullable Entries entries)
focal_class.class_method_signature: TraceCommonService.toJson(@Nullable Queries queries)
focal_class.full_signature: private static @Nullable String toJson(@Nullable Queries queries)
focal_class.identifier: toJson
focal_class.modifiers: private static @Nullable
focal_class.parameters: (@Nullable Queries queries)
focal_class.return: String
focal_class.signature: String toJson(@Nullable Queries queries)
focal_class.class_method_signature: TraceCommonService.entriesToJson(List<Trace.Entry> entries)
focal_class.full_signature: @VisibleForTesting static @Nullable String entriesToJson(List<Trace.Entry> entries)
focal_class.identifier: entriesToJson
focal_class.modifiers: @VisibleForTesting static @Nullable
focal_class.parameters: (List<Trace.Entry> entries)
focal_class.return: String
focal_class.signature: String entriesToJson(List<Trace.Entry> entries)
focal_class.class_method_signature: TraceCommonService.queriesToJson(List<Aggregate.Query> queries)
focal_class.full_signature: @VisibleForTesting static @Nullable String queriesToJson(List<Aggregate.Query> queries)
focal_class.identifier: queriesToJson
focal_class.modifiers: @VisibleForTesting static @Nullable
focal_class.parameters: (List<Aggregate.Query> queries)
focal_class.return: String
focal_class.signature: String queriesToJson(List<Aggregate.Query> queries)
focal_class.class_method_signature: TraceCommonService.sharedQueryTextsToJson(
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.full_signature: private static @Nullable String sharedQueryTextsToJson(
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.identifier: sharedQueryTextsToJson
focal_class.modifiers: private static @Nullable
focal_class.parameters: (
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.return: String
focal_class.signature: String sharedQueryTextsToJson(
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.class_method_signature: TraceCommonService.writeEntries(JsonGenerator jg, List<Trace.Entry> entries)
focal_class.full_signature: private static void writeEntries(JsonGenerator jg, List<Trace.Entry> entries)
focal_class.identifier: writeEntries
focal_class.modifiers: private static
focal_class.parameters: (JsonGenerator jg, List<Trace.Entry> entries)
focal_class.return: void
focal_class.signature: void writeEntries(JsonGenerator jg, List<Trace.Entry> entries)
focal_class.class_method_signature: TraceCommonService.writeQueries(JsonGenerator jg, List<Aggregate.Query> queries)
focal_class.full_signature: private static void writeQueries(JsonGenerator jg, List<Aggregate.Query> queries)
focal_class.identifier: writeQueries
focal_class.modifiers: private static
focal_class.parameters: (JsonGenerator jg, List<Aggregate.Query> queries)
focal_class.return: void
focal_class.signature: void writeQueries(JsonGenerator jg, List<Aggregate.Query> queries)
focal_class.class_method_signature: TraceCommonService.writeSharedQueryTexts(JsonGenerator jg,
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.full_signature: private static void writeSharedQueryTexts(JsonGenerator jg,
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.identifier: writeSharedQueryTexts
focal_class.modifiers: private static
focal_class.parameters: (JsonGenerator jg,
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.return: void
focal_class.signature: void writeSharedQueryTexts(JsonGenerator jg,
              List<Trace.SharedQueryText> sharedQueryTexts)
focal_class.class_method_signature: TraceCommonService.toJson(@Nullable Profile profile)
focal_class.full_signature: private static @Nullable String toJson(@Nullable Profile profile)
focal_class.identifier: toJson
focal_class.modifiers: private static @Nullable
focal_class.parameters: (@Nullable Profile profile)
focal_class.return: String
focal_class.signature: String toJson(@Nullable Profile profile)
focal_class.class_method_signature: TraceCommonService.toJsonLiveHeader(String agentId, Trace.Header header)
focal_class.full_signature: private String toJsonLiveHeader(String agentId, Trace.Header header)
focal_class.identifier: toJsonLiveHeader
focal_class.modifiers: private
focal_class.parameters: (String agentId, Trace.Header header)
focal_class.return: String
focal_class.signature: String toJsonLiveHeader(String agentId, Trace.Header header)
focal_class.class_method_signature: TraceCommonService.toJsonRepoHeader(String agentId, HeaderPlus header)
focal_class.full_signature: private String toJsonRepoHeader(String agentId, HeaderPlus header)
focal_class.identifier: toJsonRepoHeader
focal_class.modifiers: private
focal_class.parameters: (String agentId, HeaderPlus header)
focal_class.return: String
focal_class.signature: String toJsonRepoHeader(String agentId, HeaderPlus header)
focal_class.class_method_signature: TraceCommonService.toJson(String agentId, Trace.Header header, boolean active,
              Existence entriesExistence, Existence queriesExistence, Existence profileExistence)
focal_class.full_signature: private String toJson(String agentId, Trace.Header header, boolean active,
              Existence entriesExistence, Existence queriesExistence, Existence profileExistence)
focal_class.identifier: toJson
focal_class.modifiers: private
focal_class.parameters: (String agentId, Trace.Header header, boolean active,
              Existence entriesExistence, Existence queriesExistence, Existence profileExistence)
focal_class.return: String
focal_class.signature: String toJson(String agentId, Trace.Header header, boolean active,
              Existence entriesExistence, Existence queriesExistence, Existence profileExistence)
focal_class.class_method_signature: TraceCommonService.writeJson(Trace.Entry entry, JsonGenerator jg)
focal_class.full_signature: private static void writeJson(Trace.Entry entry, JsonGenerator jg)
focal_class.identifier: writeJson
focal_class.modifiers: private static
focal_class.parameters: (Trace.Entry entry, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeJson(Trace.Entry entry, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeJson(Aggregate.Query query, JsonGenerator jg)
focal_class.full_signature: private static void writeJson(Aggregate.Query query, JsonGenerator jg)
focal_class.identifier: writeJson
focal_class.modifiers: private static
focal_class.parameters: (Aggregate.Query query, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeJson(Aggregate.Query query, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeDetailEntries(List<Trace.DetailEntry> detailEntries, JsonGenerator jg)
focal_class.full_signature: private static void writeDetailEntries(List<Trace.DetailEntry> detailEntries, JsonGenerator jg)
focal_class.identifier: writeDetailEntries
focal_class.modifiers: private static
focal_class.parameters: (List<Trace.DetailEntry> detailEntries, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeDetailEntries(List<Trace.DetailEntry> detailEntries, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeValue(Trace.DetailValue value, JsonGenerator jg)
focal_class.full_signature: private static void writeValue(Trace.DetailValue value, JsonGenerator jg)
focal_class.identifier: writeValue
focal_class.modifiers: private static
focal_class.parameters: (Trace.DetailValue value, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeValue(Trace.DetailValue value, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeError(Trace.Error error, JsonGenerator jg)
focal_class.full_signature: private static void writeError(Trace.Error error, JsonGenerator jg)
focal_class.identifier: writeError
focal_class.modifiers: private static
focal_class.parameters: (Trace.Error error, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeError(Trace.Error error, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeThrowable(Proto.Throwable throwable, boolean hasEnclosing,
              JsonGenerator jg)
focal_class.full_signature: private static void writeThrowable(Proto.Throwable throwable, boolean hasEnclosing,
              JsonGenerator jg)
focal_class.identifier: writeThrowable
focal_class.modifiers: private static
focal_class.parameters: (Proto.Throwable throwable, boolean hasEnclosing,
              JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeThrowable(Proto.Throwable throwable, boolean hasEnclosing,
              JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeTimer(Trace.Timer timer, JsonGenerator jg)
focal_class.full_signature: private static void writeTimer(Trace.Timer timer, JsonGenerator jg)
focal_class.identifier: writeTimer
focal_class.modifiers: private static
focal_class.parameters: (Trace.Timer timer, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeTimer(Trace.Timer timer, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeOldThreadStats(Trace.OldThreadStats threadStats, JsonGenerator jg)
focal_class.full_signature: private static void writeOldThreadStats(Trace.OldThreadStats threadStats, JsonGenerator jg)
focal_class.identifier: writeOldThreadStats
focal_class.modifiers: private static
focal_class.parameters: (Trace.OldThreadStats threadStats, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeOldThreadStats(Trace.OldThreadStats threadStats, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeThreadStats(Trace.ThreadStats threadStats, JsonGenerator jg)
focal_class.full_signature: private static void writeThreadStats(Trace.ThreadStats threadStats, JsonGenerator jg)
focal_class.identifier: writeThreadStats
focal_class.modifiers: private static
focal_class.parameters: (Trace.ThreadStats threadStats, JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeThreadStats(Trace.ThreadStats threadStats, JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.writeStackTraceElement(Proto.StackTraceElement stackTraceElement,
              JsonGenerator jg)
focal_class.full_signature: private static void writeStackTraceElement(Proto.StackTraceElement stackTraceElement,
              JsonGenerator jg)
focal_class.identifier: writeStackTraceElement
focal_class.modifiers: private static
focal_class.parameters: (Proto.StackTraceElement stackTraceElement,
              JsonGenerator jg)
focal_class.return: void
focal_class.signature: void writeStackTraceElement(Proto.StackTraceElement stackTraceElement,
              JsonGenerator jg)
focal_class.class_method_signature: TraceCommonService.getFileName(Trace.Header header)
focal_class.full_signature: private static String getFileName(Trace.Header header)
focal_class.identifier: getFileName
focal_class.modifiers: private static
focal_class.parameters: (Trace.Header header)
focal_class.return: String
focal_class.signature: String getFileName(Trace.Header header)
focal_method.body: @VisibleForTesting
      static @Nullable String entriesToJson(List<Trace.Entry> entries) throws IOException {
          if (entries.isEmpty()) {
              return null;
          }
          StringBuilder sb = new StringBuilder();
          JsonGenerator jg = jsonFactory.createGenerator(CharStreams.asWriter(sb));
          try {
              writeEntries(jg, entries);
          } finally {
              jg.close();
          }
          return sb.toString();
      }
focal_method.class_method_signature: TraceCommonService.entriesToJson(List<Trace.Entry> entries)
focal_method.full_signature: @VisibleForTesting static @Nullable String entriesToJson(List<Trace.Entry> entries)
focal_method.identifier: entriesToJson
focal_method.invocations: isEmpty createGenerator asWriter writeEntries close toString
focal_method.modifiers: @VisibleForTesting static @Nullable
focal_method.parameters: (List<Trace.Entry> entries)
focal_method.return: String
focal_method.signature: String entriesToJson(List<Trace.Entry> entries)