<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "EnergyKit",
  "identifier" : "/documentation/EnergyKit/ElectricityInsightService/runtimeInsights(forDeviceID:using:atVenue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "EnergyKit"
    ],
    "preciseIdentifier" : "s:9EnergyKit25ElectricityInsightServiceC15runtimeInsights11forDeviceID5using7atVenueScSyAA0cD6RecordVys8DurationVGGSS_AA0cD5QueryV10Foundation4UUIDVtYaKF"
  },
  "title" : "runtimeInsights(forDeviceID:using:atVenue:)"
}
-->

# runtimeInsights(forDeviceID:using:atVenue:)

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

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

## Parameters

`deviceID`

The device identifier to return [`ElectricityInsightRecord`](/documentation/EnergyKit/ElectricityInsightRecord)s for.

`query`

The [`ElectricityInsightQuery`](/documentation/EnergyKit/ElectricityInsightQuery) to specify the results.

`energyVenueID`

The [`EnergyVenue`](/documentation/EnergyKit/EnergyVenue) identifier to return [`ElectricityInsightRecord`](/documentation/EnergyKit/ElectricityInsightRecord)s for.

## Return Value

An `AsyncStream` of [`ElectricityInsightRecord`](/documentation/EnergyKit/ElectricityInsightRecord)s containing `Duration` values for a given device.

## Discussion

The system throws [`EnergyKitError.venueUnavailable`](/documentation/EnergyKit/EnergyKitError/venueUnavailable) if a person provides an invalid [`EnergyVenue`](/documentation/EnergyKit/EnergyVenue) identifier.
If another request is in progress, the system throws[`EnergyKitError.inProgress`](/documentation/EnergyKit/EnergyKitError/inProgress).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)