Class ClientSample
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetAgeMs()How long this sample sat in the browser's buffer while the browser could not reach the server, measured at flush time.Free-form context that describes the sample but must never become a meter tag: the message, source and first stack frame of a browser error, and the path it happened on.getName()getTags()longgetTs()doublevoidsetAgeMs(long ageMs) voidvoidvoidvoidsetTs(long ts) voidsetValueMs(double valueMs)
-
Constructor Details
-
ClientSample
public ClientSample()
-
-
Method Details
-
getName
-
setName
-
getTags
-
setTags
-
getDetail
Free-form context that describes the sample but must never become a meter tag: the message, source and first stack frame of a browser error, and the path it happened on. It is what a counter cannot carry — a number says an error happened, not what it was — so the values here feed the insight the sample produces, never its tags.- Returns:
- the detail map, empty when the browser sent none
-
setDetail
-
getValueMs
public double getValueMs() -
setValueMs
public void setValueMs(double valueMs) -
getTs
public long getTs() -
setTs
public void setTs(long ts) -
getAgeMs
public long getAgeMs()How long this sample sat in the browser's buffer while the browser could not reach the server, measured at flush time.Offline time, not elapsed time. The collector flushes on an interval, so every sample waits a little; what makes a sample interesting is having waited because the server was unreachable, and only that is counted here.
A non-zero value says this sample could not be sent when it was taken. It does not say the thing it describes happened during an outage: a sample taken while the browser was connected still accrues the outage that begins before the next flush. The distinction matters for a browser error, where it is tempting to read the number as "this error happened while the user was offline".
Computed in the browser on purpose, and on a monotonic clock rather than the one that produced
getTs(). A sample taken while the connection was down can only arrive once it is back, so subtractingtsfrom the arrival time would report the skew between two machines' clocks rather than a delay — and a wall clock that steps mid-outage, which is exactly when this is being measured, would corrupt the figure even on one machine.- Returns:
- the offline wait in milliseconds,
0for a sample that only waited for the next flush
-
setAgeMs
public void setAgeMs(long ageMs)
-