ConnectionProfile.GetNetworkUsageAsync(DateTimeOffset, DateTimeOffset, DataUsageGranularity, NetworkUsageStates) Method

Definition

Gets a list of the estimated data traffic and connection duration over a specified period of time, for a specific network usage state.

DataUsageGranularity is used to indicate the desired granularity of the returned data and affects the length of the returned list. NetworkUsageStates is used to indicate the desired network usage configuration.

public:
 virtual IAsyncOperation<IVectorView<NetworkUsage ^> ^> ^ GetNetworkUsageAsync(DateTime startTime, DateTime endTime, DataUsageGranularity granularity, NetworkUsageStates states) = GetNetworkUsageAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<NetworkUsage>> GetNetworkUsageAsync(DateTime startTime, DateTime endTime, DataUsageGranularity granularity, NetworkUsageStates states);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<NetworkUsage>> GetNetworkUsageAsync(System.DateTimeOffset startTime, System.DateTimeOffset endTime, DataUsageGranularity granularity, NetworkUsageStates states);
function getNetworkUsageAsync(startTime, endTime, granularity, states)
Public Function GetNetworkUsageAsync (startTime As DateTimeOffset, endTime As DateTimeOffset, granularity As DataUsageGranularity, states As NetworkUsageStates) As IAsyncOperation(Of IReadOnlyList(Of NetworkUsage))

Parameters

startTime
DateTimeOffset

The start time over which to retrieve data. Can be no more than 60 days prior to the current time. If the specified granularity is PerMinute, then the start time can be no more than 120 minutes prior to the current time.

endTime
DateTimeOffset

The end time over which to retrieve data.

granularity
DataUsageGranularity

The desired granularity of the returned usage statistics. Each elements in the list corresponds to the network usage per the specified granularity; for example, usage per hour.

states
NetworkUsageStates

The state of the connection profile for which usage data should be returned.

Returns

IAsyncOperation<IReadOnlyList<NetworkUsage>>

When the method completes, it returns a list of NetworkUsage objects, which indicate the sent and received values, in bytes, and the total amount of time the profile was connected during the corresponding time interval.

Attributes

Remarks

For an example of how these methods are used, see How to retrieve connection usage data for a specific period of time.

Applies to

See also