# Insight

Artifact: [androidx.benchmark:benchmark-traceprocessor](https://developer.android.com/jetpack/androidx/releases/benchmark) [View Source](https://cs.android.com/search?q=file:androidx/benchmark/traceprocessor/Insight.kt+class:androidx.benchmark.traceprocessor.Insight) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

*** ** * ** ***


```
@ExperimentalInsightApi
public final class Insight
```

<br />

*** ** * ** ***

Individual case of a problem identified in a given trace (from a specific iteration).

Benchmark output will summarize multiple insights, for example:

```
[JIT Activity](https://d.android.com/test#JIT_ACTIVITY) (expected: < 100000000ns)
seen in iterations: [6](file:///path/to/trace.perfetto-trace)(328462261ns),
```

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/benchmark/traceprocessor/ExperimentalInsightApi public final class https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight.Category` Category represents general expectations that have been violated by an insight - e.g. JIT shouldn't take longer than XX ms, or trampoline activities shouldn't be used. |
| `@https://developer.android.com/reference/androidx/benchmark/traceprocessor/ExperimentalInsightApi public interface https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight.Provider` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#Insight(androidx.benchmark.traceprocessor.Insight.Category,kotlin.String,androidx.benchmark.traceprocessor.PerfettoTrace.Link)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight.Category category, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html observedLabel, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/traceprocessor/PerfettoTrace.Link traceLink )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight.Category` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#getCategory()()` Category of the Insight, representing the type of problem. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#getObservedLabel()()` suffix after the deeplink to convey problem severity, e.g. "(100000000ns)" |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/benchmark/traceprocessor/PerfettoTrace.Link` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#getTraceLink()()` Link to content within a trace to highlight for the given problem. |
| `int` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight#toString()()` |

## Public constructors

### Insight

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
public Insight(
    @NonNull Insight.Category category,
    @NonNull String observedLabel,
    @NonNull PerfettoTrace.Link traceLink
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getCategory

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
public final @NonNull Insight.Category getCategory()
```

Category of the Insight, representing the type of problem.

Every similar insight must identify equal `https://developer.android.com/reference/androidx/benchmark/traceprocessor/Insight.Category`s to enable macrobenchmark to group them across iterations.

### getObservedLabel

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
public final @NonNull String getObservedLabel()
```

suffix after the deeplink to convey problem severity, e.g. "(100000000ns)"

### getTraceLink

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.4.0)

```
public final @NonNull PerfettoTrace.Link getTraceLink()
```

Link to content within a trace to highlight for the given problem.

Insights should specify `https://developer.android.com/reference/androidx/benchmark/traceprocessor/PerfettoTrace.Link#urlParamsEncoded()` to pass context to [ui.perfetto.dev](https://ui.perfetto.dev).

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```