Codota Logo
DiagnosisDataAggregator
Code IndexAdd Codota to your IDE (free)

How to use
DiagnosisDataAggregator
in
rocks.inspectit.server.diagnosis.service.aggregation

Best Java code snippets using rocks.inspectit.server.diagnosis.service.aggregation.DiagnosisDataAggregator (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

/**
 * Add one InvocationSequenceData to the aggregation.
 *
 * @param invocationSequenceData
 *            invocationSequenceData to be aggregated
 */
public void aggregateInvocationSequenceData(InvocationSequenceData invocationSequenceData) {
  Object key = DIAGNOSIS_DATA_AGGREGATOR.getAggregationKey(invocationSequenceData);
  AggregatedDiagnosisData aggregatedObject = diagnosisDataAggregationMap.get(key);
  if (null != aggregatedObject) {
    DIAGNOSIS_DATA_AGGREGATOR.aggregate(aggregatedObject, invocationSequenceData);
  } else {
    aggregatedObject = DIAGNOSIS_DATA_AGGREGATOR.getAggregatedDiagnosisData(invocationSequenceData);
    diagnosisDataAggregationMap.put(key, aggregatedObject);
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = IllegalArgumentException.class)
private void musteReturnAnExceptionIfThereIsNoTimerData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData);
}
origin: inspectIT/inspectIT

/**
 * Aggregate all the invocations that are considered as rootCause to the object
 * {@link RootCause}.
 *
 * @return Returns the number of candidates that are already checked.
 */
private int getRootCauses() {
  int causeCandidatesChecked = 0;
  double problemContextCommonContextDuration = InvocationSequenceDataHelper.calculateDuration(problemContext.getCommonContext());
  // Root Cause candidates are put into one Root Cause as long as the condition is true.
  while ((sumExclusiveTime < (PROPORTION * problemContextCommonContextDuration)) && (causeCandidatesChecked < causeCandidates.size())) {
    InvocationSequenceData invocation = causeCandidates.get(causeCandidatesChecked);
    if (null == rootCause) {
      rootCause = diagnosisDataAggregator.getAggregatedDiagnosisData(invocation);
    } else {
      diagnosisDataAggregator.aggregate(rootCause, invocation);
    }
    sumExclusiveTime += DiagnosisHelper.getExclusiveDuration(invocation);
    causeCandidatesChecked++;
  }
  return causeCandidatesChecked;
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = RuntimeException.class)
public void collectProblemInstancesWithRuntimeExceptionProblemContext() {
  CauseStructure causeStructure = new CauseStructure(CauseType.SINGLE, SourceType.TIMERDATA);
  AggregatedDiagnosisData aggregatedInvocationSequenceData = null;
  aggregatedInvocationSequenceData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(secondChildSequence);
  DiagnosisDataAggregator.getInstance().aggregate(aggregatedInvocationSequenceData, secondChildSequence);
  Multimap<String, Tag> tagMap = ArrayListMultimap.create();
  Tag tagOne = new Tag(RuleConstants.DIAGNOSIS_TAG_GLOBAL_CONTEXT, secondChildSequence, Tags.rootTag(secondChildSequence));
  Tag tagTwo = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT, "Test", tagOne);
  Tag tagThree = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CAUSE, aggregatedInvocationSequenceData, tagTwo);
  Tag tagFour = new Tag(RuleConstants.DIAGNOSIS_TAG_CAUSE_STRUCTURE, causeStructure, tagThree);
  tagMap.put("D", tagFour);
  when(sessionContext.getInput()).thenReturn(secondChildSequence);
  when(sessionContext.getStorage()).thenReturn(storage);
  when(storage.mapTags(TagState.LEAF)).thenReturn(tagMap);
  ProblemOccurrenceResultCollector problemInstanceResultCollector = new ProblemOccurrenceResultCollector();
  List<ProblemOccurrence> problemOccurrence = problemInstanceResultCollector.collect(sessionContext);
  assertThat(problemOccurrence, hasSize(0));
}
origin: inspectIT/inspectIT

  @Test
  private void musteReturnAnObjectWithALongStringIfTheTimerDataHasNotHttpTimerDataOrSqlData() {
    InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
    TimerData timerData = new TimerData();
    invocationSequenceData.setTimerData(timerData);
    long aggregationKey = (long) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData);
    assertThat("The returned object must be the method ident of the invocationsequencedata", aggregationKey, is(invocationSequenceData.getMethodIdent()));
  }
}
origin: inspectIT/inspectIT

/**
 * Checks whether the passed {@link #InvocationSequenceData} is a <code>Root
 * Cause</code>.
 *
 * @param invocation
 *            The {@link InvocationSequenceData} that is investigated.
 * @return Whether the {@link InvocationSequenceData} is a <code>Root Cause</code>.
 */
private boolean isCauseInvocation(InvocationSequenceData invocation) {
  Object key = diagnosisDataAggregator.getAggregationKey(invocation);
  if (key.equals(rootCause.getAggregationKey())) {
    return true;
  }
  return false;
}
origin: inspectIT/inspectIT

double duration = DiagnosisHelper.getExclusiveDuration(invocation);
if (duration > lowerThreshold) {
  diagnosisDataAggregator.aggregate(rootCause, invocation);
} else {
  break;
origin: inspectIT/inspectIT

@Test(expectedExceptions = RuntimeException.class)
public void collectProblemInstancesWithRuntimeExceptionCauseStructure() {
  AggregatedDiagnosisData aggregatedInvocationSequenceData = null;
  aggregatedInvocationSequenceData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(secondChildSequence);
  DiagnosisDataAggregator.getInstance().aggregate(aggregatedInvocationSequenceData, secondChildSequence);
  Multimap<String, Tag> tagMap = ArrayListMultimap.create();
  Tag tagOne = new Tag(RuleConstants.DIAGNOSIS_TAG_GLOBAL_CONTEXT, secondChildSequence, Tags.rootTag(secondChildSequence));
  Tag tagTwo = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT, new CauseCluster(secondChildSequence), tagOne);
  Tag tagThree = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CAUSE, aggregatedInvocationSequenceData, tagTwo);
  Tag tagFour = new Tag(RuleConstants.DIAGNOSIS_TAG_CAUSE_STRUCTURE, "Test", tagThree);
  tagMap.put("D", tagFour);
  when(sessionContext.getInput()).thenReturn(secondChildSequence);
  when(sessionContext.getStorage()).thenReturn(storage);
  when(storage.mapTags(TagState.LEAF)).thenReturn(tagMap);
  ProblemOccurrenceResultCollector problemInstanceResultCollector = new ProblemOccurrenceResultCollector();
  List<ProblemOccurrence> problemOccurrence = problemInstanceResultCollector.collect(sessionContext);
  assertThat(problemOccurrence, hasSize(0));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasHttpTimerData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  HttpTimerData timerData = new HttpTimerData(new Timestamp(10), 10, 10, 108L);
  HttpInfo httpInfo = new HttpInfo("URI", "requestMethod", "headerValue");
  timerData.setHttpInfo(httpInfo);
  invocationSequenceData.setTimerData(timerData);
  Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData);
  assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(timerData.getHttpInfo().getUri()));
}
origin: inspectIT/inspectIT

/**
 * Convert a {@link InvocationSequenceData} to a {@link AggregatedDiagnosisData}.
 *
 * @param invocationSequenceData
 *            input invocationSequenceData
 * @return AggregatedDiagnosisData based on invocationSequenceData
 */
public AggregatedDiagnosisData getAggregatedDiagnosisData(InvocationSequenceData invocationSequenceData) {
  if (InvocationSequenceDataHelper.hasHttpTimerData(invocationSequenceData)) {
    return new AggregatedDiagnosisData(SourceType.HTTP, invocationSequenceData, getAggregationKey(invocationSequenceData));
  } else if (InvocationSequenceDataHelper.hasSQLData(invocationSequenceData)) {
    return new AggregatedDiagnosisData(SourceType.DATABASE, invocationSequenceData, getAggregationKey(invocationSequenceData));
  } else if (InvocationSequenceDataHelper.hasTimerData(invocationSequenceData)) {
    return new AggregatedDiagnosisData(SourceType.TIMERDATA, invocationSequenceData, getAggregationKey(invocationSequenceData));
  } else {
    throw new IllegalArgumentException("No timer data available!");
  }
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = RuntimeException.class)
public void collectProblemInstancesWithRuntimeExceptionGlobalContext() {
  CauseStructure causeStructure = new CauseStructure(CauseType.SINGLE, SourceType.TIMERDATA);
  AggregatedDiagnosisData aggregatedInvocationSequenceData = null;
  aggregatedInvocationSequenceData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(secondChildSequence);
  DiagnosisDataAggregator.getInstance().aggregate(aggregatedInvocationSequenceData, secondChildSequence);
  Multimap<String, Tag> tagMap = ArrayListMultimap.create();
  Tag tagOne = new Tag(RuleConstants.DIAGNOSIS_TAG_GLOBAL_CONTEXT, "Test", Tags.rootTag(secondChildSequence));
  Tag tagTwo = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT, new CauseCluster(secondChildSequence), tagOne);
  Tag tagThree = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CAUSE, aggregatedInvocationSequenceData, tagTwo);
  Tag tagFour = new Tag(RuleConstants.DIAGNOSIS_TAG_CAUSE_STRUCTURE, causeStructure, tagThree);
  tagMap.put("D", tagFour);
  when(sessionContext.getInput()).thenReturn(secondChildSequence);
  when(sessionContext.getStorage()).thenReturn(storage);
  when(storage.mapTags(TagState.LEAF)).thenReturn(tagMap);
  ProblemOccurrenceResultCollector problemInstanceResultCollector = new ProblemOccurrenceResultCollector();
  List<ProblemOccurrence> problemOccurrence = problemInstanceResultCollector.collect(sessionContext);
  assertThat(problemOccurrence, hasSize(0));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnInstanceWithTimerDataSourceTypeDataIfTheTimerDataIsTimerData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  TimerData timerData = new TimerData();
  invocationSequenceData.setTimerData(timerData);
  AggregatedDiagnosisData aggregatedDiagnosisData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData);
  assertThat("The object must have TIMERDATA as source type", aggregatedDiagnosisData.getSourceType(), is(SourceType.TIMERDATA));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasSqlData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L);
  sqlStatementData.setCount(1);
  sqlStatementData.setSql("blahblahblah");
  invocationSequenceData.setSqlStatementData(sqlStatementData);
  TimerData timerData = new TimerData();
  invocationSequenceData.setTimerData(timerData);
  Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData);
  assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(sqlStatementData.getSql()));
}
origin: inspectIT/inspectIT

@Test(expectedExceptions = RuntimeException.class)
public void collectProblemInstancesWithRuntimeExceptionRootCause() {
  CauseStructure causeStructure = new CauseStructure(CauseType.SINGLE, SourceType.TIMERDATA);
  AggregatedDiagnosisData aggregatedInvocationSequenceData = null;
  aggregatedInvocationSequenceData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(secondChildSequence);
  DiagnosisDataAggregator.getInstance().aggregate(aggregatedInvocationSequenceData, secondChildSequence);
  Multimap<String, Tag> tagMap = ArrayListMultimap.create();
  Tag tagOne = new Tag(RuleConstants.DIAGNOSIS_TAG_GLOBAL_CONTEXT, secondChildSequence, Tags.rootTag(secondChildSequence));
  Tag tagTwo = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT, new CauseCluster(secondChildSequence), tagOne);
  Tag tagThree = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CAUSE, "Test", tagTwo);
  Tag tagFour = new Tag(RuleConstants.DIAGNOSIS_TAG_CAUSE_STRUCTURE, causeStructure, tagThree);
  tagMap.put("D", tagFour);
  when(sessionContext.getInput()).thenReturn(secondChildSequence);
  when(sessionContext.getStorage()).thenReturn(storage);
  when(storage.mapTags(TagState.LEAF)).thenReturn(tagMap);
  ProblemOccurrenceResultCollector problemInstanceResultCollector = new ProblemOccurrenceResultCollector();
  List<ProblemOccurrence> problemOccurrence = problemInstanceResultCollector.collect(sessionContext);
  assertThat(problemOccurrence, hasSize(0));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnInstanceWithHttpSourceTypeDataIfTheTimerDataIsHttpTimerData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  HttpTimerData timerData = new HttpTimerData();
  invocationSequenceData.setTimerData(timerData);
  AggregatedDiagnosisData aggregatedDiagnosisData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData);
  assertThat("The object must have HTTP as source type", aggregatedDiagnosisData.getSourceType(), is(SourceType.HTTP));
}
origin: inspectIT/inspectIT

@Test
public void collectProblemInstances() {
  CauseStructure causeStructure = new CauseStructure(CauseType.SINGLE, SourceType.TIMERDATA);
  AggregatedDiagnosisData aggregatedInvocationSequenceData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(secondChildSequence);
  DiagnosisDataAggregator.getInstance().aggregate(aggregatedInvocationSequenceData, secondChildSequence);
  Multimap<String, Tag> tagMap = ArrayListMultimap.create();
  Tag tagOne = new Tag(RuleConstants.DIAGNOSIS_TAG_GLOBAL_CONTEXT, secondChildSequence, Tags.rootTag(secondChildSequence));
  Tag tagTwo = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT, new CauseCluster(secondChildSequence), tagOne);
  Tag tagThree = new Tag(RuleConstants.DIAGNOSIS_TAG_PROBLEM_CAUSE, aggregatedInvocationSequenceData, tagTwo);
  Tag tagFour = new Tag(RuleConstants.DIAGNOSIS_TAG_CAUSE_STRUCTURE, causeStructure, tagThree);
  tagMap.put("Test", tagFour);
  when(sessionContext.getInput()).thenReturn(secondChildSequence);
  when(sessionContext.getStorage()).thenReturn(storage);
  when(storage.mapTags(TagState.LEAF)).thenReturn(tagMap);
  ProblemOccurrenceResultCollector problemInstanceResultCollector = new ProblemOccurrenceResultCollector();
  List<ProblemOccurrence> problemOccurrence = problemInstanceResultCollector.collect(sessionContext);
  assertThat(problemOccurrence, hasSize(1));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnInstanceWithDataBaseSourceTypeDataIfHasSqlData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L);
  sqlStatementData.setCount(1);
  sqlStatementData.setSql("blahblahblah");
  invocationSequenceData.setSqlStatementData(sqlStatementData);
  AggregatedDiagnosisData aggregatedDiagnosisData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData);
  assertThat("The object must have DATABASE as source type", aggregatedDiagnosisData.getSourceType(), is(SourceType.DATABASE));
}
origin: inspectIT/inspectIT

  @Test
  private void mustReturnAnInstanceWithDataBaseSourceTypeDataIfHasSqlDataAndTimerData() {
    InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
    SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L);
    sqlStatementData.setCount(1);
    sqlStatementData.setSql("blahblahblah");
    invocationSequenceData.setSqlStatementData(sqlStatementData);
    TimerData timerData = new TimerData(new Timestamp(10), 10L, 20, 108L);
    invocationSequenceData.setTimerData(timerData);
    AggregatedDiagnosisData aggregatedDiagnosisData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData);
    assertThat("The object must have DATABASE as source type", aggregatedDiagnosisData.getSourceType(), is(SourceType.DATABASE));
  }
}
rocks.inspectit.server.diagnosis.service.aggregationDiagnosisDataAggregator

Javadoc

Aggregation for InvocationSequenceData. Note: When InvocationSequenceData elements are aggregated, then the invocation structure is ignored for aggregation.

Most used methods

  • aggregate
    Aggregate the InvocationSequenceData to the AggregatedDiagnosisData.
  • getAggregatedDiagnosisData
    Convert a InvocationSequenceData to a AggregatedDiagnosisData.
  • getAggregationKey
    Get key for aggregation.
  • getInstance

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now