Google.Maps.Logging.MetricsSampler.MetricsSamplerHelper

A helper class that removes the dependency on Unity runtime for frame timing information, and the dependency on static LogsService.

Summary

Constructors and Destructors

MetricsSamplerHelper(GetFrameTimeDelegate getFrameTime, LogFrameTimeDelegate logFrameTime)
Constructor.

Public attributes

FrameTimeSamplePeriodSeconds = 30
float
Time between frame time samples.
FrameTimeVarianceSeconds = 5
float
Random variance range for frame time sample period, from 0 to this value.

Public functions

CollectFrameRateStats()
IEnumerator
Periodically log most recent frame elapsed time.
GetFrameTimeDelegate()
delegate float
Delegate function that returns a frame time in seconds.
LogFrameTimeDelegate(int frameTimeMs)
delegate void
Delegate that logs a frame time value.

Public attributes

FrameTimeSamplePeriodSeconds

float FrameTimeSamplePeriodSeconds = 30

Time between frame time samples.

FrameTimeVarianceSeconds

float FrameTimeVarianceSeconds = 5

Random variance range for frame time sample period, from 0 to this value.

This value provides a bit of jitter to our frame rate sampling timing to avoid potential issues arising from sampling at precisely the same interval every time.

Public functions

CollectFrameRateStats

IEnumerator CollectFrameRateStats()

Periodically log most recent frame elapsed time.

GetFrameTimeDelegate

delegate float GetFrameTimeDelegate()

Delegate function that returns a frame time in seconds.

LogFrameTimeDelegate

delegate void LogFrameTimeDelegate(
  int frameTimeMs
)

Delegate that logs a frame time value.

MetricsSamplerHelper

 MetricsSamplerHelper(
  GetFrameTimeDelegate getFrameTime,
  LogFrameTimeDelegate logFrameTime
)

Constructor.

Details
Parameters
getFrameTime
Frame time fetching delegate.
logFrameTime
Frame time logging delegate.