FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kHealthSummary Class Reference

Description

Represents a summary of health log data.

Health log summaries consist of a set of stat items, where each stat corresponds to one health statistic in a health log. Each stat consists of metadata (name, id, instance) and an array of health log entries (k64s values) that were collected over time.

All stat arrays contain the same number of log entries. Entries that were missing/inaccessible in the original log data are represented by k64S_NULL.

Stat items are ordered alphabetically according to stat name.

The following example (based on the implementation of kHealthSummary_ToString) illustrates how to format the content of a health summary as a CSV string.

kStatus FormatHealthSummary(kHealthSummary summary, kString str)
{
for (kSize i = 0; i < kHealthSummary_StatCount(summary); ++i)
{
kCheck(kString_Addf(str, "%s,", kHealthSummary_StatName(summary, stat)));
for (kSize j = 0; j < kHealthSummary_EntryCount(summary); ++j)
{
k64s entry = kHealthSummary_EntryAt(summary, stat, j);
if (entry != k64S_NULL)
{
kCheck(kString_Addf(str, "%lld,", entry));
}
else
{
kCheck(kString_Addf(str, ","));
}
}
kCheck(kString_Addf(str, "\n"));
}
return kOK;
}

kHealthSummary supports the kObject_Clone and kObject_Size methods.

kHealthSummary supports the kdat6 serialization protocol.

Inheritance diagram for kHealthSummary:
Inheritance graph

Public Member Functions

kStatus kHealthSummary_AddStat (kHealthSummary summary, const kChar *name, kHealthId id, k32u instance, kHealthSummaryStat *stat)
 Adds a stat to the log. More...
 
kStatus kHealthSummary_BeginCompose (kHealthSummary summary, kSize entryCount)
 Opens the health summary for writing. More...
 
kStatus kHealthSummary_Construct (kHealthSummary *summary, kAlloc allocator)
 Constructs a kHealthSummary object. More...
 
kStatus kHealthSummary_EndCompose (kHealthSummary summary)
 Closes the health summary for writing. More...
 
k64s kHealthSummary_EntryAt (kHealthSummary summary, kHealthSummaryStat stat, kSize index)
 Returns the log entry associated with the specified stat at the specified log entry index. More...
 
kSize kHealthSummary_EntryCount (kHealthSummary summary)
 Reports the number of log entries per stat in the summary. More...
 
kArrayList kHealthSummary_EntryData (kHealthSummary summary, kHealthSummaryStat stat)
 Provides a reference to the entry array associated with the specified stat. More...
 
kStatus kHealthSummary_EntryItem (kHealthSummary summary, kHealthSummaryStat stat, kSize index, k64s *value)
 Gets the log entry associated with the specified stat at the specified log entry index. More...
 
kStatus kHealthSummary_FindStat (kHealthSummary summary, kHealthId id, k32u instance, kHealthSummaryStat *stat)
 Looks up a stat item by its unique id-instance pair. More...
 
kHealthSummaryStat kHealthSummary_StatAt (kHealthSummary summary, kSize index)
 Returns a reference to the stat item at the specified index. More...
 
kSize kHealthSummary_StatCount (kHealthSummary summary)
 Reports the number of stats represented in the summary. More...
 
kHealthId kHealthSummary_StatId (kHealthSummary summary, kHealthSummaryStat stat)
 Reports the ID associated with the specified health stat. More...
 
k32u kHealthSummary_StatInstance (kHealthSummary summary, kHealthSummaryStat stat)
 Reports the instance value associated with the specified health stat. More...
 
kStatus kHealthSummary_StatItem (kHealthSummary summary, kSize index, kHealthSummaryStat *stat)
 Gets a reference to the stat item at the specified index. More...
 
const kCharkHealthSummary_StatName (kHealthSummary summary, kHealthSummaryStat stat)
 Reports the name of the specified health stat. More...
 
kStatus kHealthSummary_ToString (kHealthSummary summary, kString str)
 Prints the contents of the summary to a readable string. More...
 

The documentation for this class was generated from the following file: