---
title: "runtimeInsights(forDeviceID:using:atVenue:)"
framework: energykit
role: symbol
role_heading: Instance Method
path: "energykit/electricityinsightservice/runtimeinsights(fordeviceid:using:atvenue:)"
---

# runtimeInsights(forDeviceID:using:atVenue:)

Returns records that provide insight into runtime of a given device.

## Declaration

```swift
final func runtimeInsights(forDeviceID deviceID: String, using query: ElectricityInsightQuery, atVenue energyVenueID: UUID) async throws -> AsyncStream<ElectricityInsightRecord<Duration>>
```

## Parameters

- `deviceID`: The device identifier to return doc://com.apple.energykit/documentation/EnergyKit/ElectricityInsightRecords for.
- `query`: The doc://com.apple.energykit/documentation/EnergyKit/ElectricityInsightQuery to specify the results.
- `energyVenueID`: The doc://com.apple.energykit/documentation/EnergyKit/EnergyVenue identifier to return doc://com.apple.energykit/documentation/EnergyKit/ElectricityInsightRecords for.

## Return Value

Return Value An AsyncStream of ElectricityInsightRecords containing Duration values for a given device.

## Discussion

Discussion The system throws EnergyKitError.venueUnavailable if a person provides an invalid EnergyVenue identifier. If another request is in progress, the system throwsEnergyKitError.inProgress.

## See Also

### Getting device insights

- [energyInsights(forDeviceID:using:atVenue:)](energykit/electricityinsightservice/energyinsights(fordeviceid:using:atvenue:).md)
