Hi,
I have this code
IStorageConnection connection = JobStorage.Current.GetConnection();
StateData stateData = connection.GetStateData(context.BackgroundJob.Id);
TimeSpan elapsedTime = new TimeSpan();
if ((stateData.Data.ContainsKey("PerformanceDuration")) && (stateData.Data.ContainsKey("Latency")))
{
TimeSpan duration = TimeSpan.FromMilliseconds(long.Parse(stateData.Data["PerformanceDuration"]));
TimeSpan latency = TimeSpan.FromMilliseconds(long.Parse(stateData.Data["Latency"]));
elapsedTime = duration + latency;
}
But there are case on the stateData.Data is not contains the PerformanceDuration key.
How to get the Total duration time of succedeed jobs ?
Thanks