# WorkMetricsQuery

Artifact: [androidx.work:work-analytics](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/analytics/WorkMetricsQuery.kt+class:androidx.work.analytics.WorkMetricsQuery) Added in [2.12.0](https://developer.android.com/jetpack/androidx/releases/work#2.12.0)

*** ** * ** ***


```
@ExperimentalWorkMetricsApi
class WorkMetricsQuery
```

<br />

*** ** * ** ***

A specification for querying `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsInfo`s.

Each component in a `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery` is `AND`-ed with the others. Each value in a component is `OR`-ed.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#beginTimeMillis()` The start of the enqueue time range filter (inclusive), in milliseconds since epoch (e.g. `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#endTimeMillis()` The end of the enqueue time range filter (inclusive), in milliseconds since epoch (e.g. `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsInfo.State>` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#states()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsInfo.State`s being queried. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#tags()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of tags being queried. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/java/util/UUID.html>` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#workIds()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` ids being queried. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsQuery#workerClassNames()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of worker class names being queried. |

## Public properties

### beginTimeMillis

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

```
val beginTimeMillis: Long
```

The start of the enqueue time range filter (inclusive), in milliseconds since epoch (e.g. `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`).

### endTimeMillis

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

```
val endTimeMillis: Long
```

The end of the enqueue time range filter (inclusive), in milliseconds since epoch (e.g. `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`).

### states

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

```
val states: List<WorkMetricsInfo.State>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/work/analytics/WorkMetricsInfo.State`s being queried.

### tags

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

```
val tags: List<String>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of tags being queried.

### workIds

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

```
val workIds: List<UUID>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` ids being queried.

### workerClassNames

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

```
val workerClassNames: List<String>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of worker class names being queried.