Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
NanoJSONResultsWriter Class Reference

#include <ResultsWriter.h>

Inheritance diagram for NanoJSONResultsWriter:
SkJSONWriter SkNoncopyable

Public Member Functions

 NanoJSONResultsWriter (SkWStream *stream, Mode mode)
 
void beginBench (const char *name, int32_t x, int32_t y)
 
void endBench ()
 
void appendMetric (const char *name, double value)
 
- Public Member Functions inherited from SkJSONWriter
 SkJSONWriter (SkWStream *stream, Mode mode=Mode::kFast)
 
 ~SkJSONWriter ()
 
void flush ()
 
void appendName (const char *name)
 
void beginObject (const char *name=nullptr, bool multiline=true)
 
void endObject ()
 
void beginArray (const char *name=nullptr, bool multiline=true)
 
void endArray ()
 
void appendString (const char *value, size_t size)
 
void appendString (const SkString &value)
 
template<class T , std::enable_if_t< std::is_same_v< T, std::string >, bool > = false>
void appendString (const T &value)
 
template<size_t N>
void appendNString (char const (&value)[N])
 
void appendCString (const char *value)
 
void appendPointer (const void *value)
 
void appendBool (bool value)
 
void appendS32 (int32_t value)
 
void appendS64 (int64_t value)
 
void appendU32 (uint32_t value)
 
void appendU64 (uint64_t value)
 
void appendFloat (float value)
 
void appendDouble (double value)
 
void appendFloatDigits (float value, int digits)
 
void appendDoubleDigits (double value, int digits)
 
void appendHexU32 (uint32_t value)
 
void appendHexU64 (uint64_t value)
 
void appendString (const char *name, const char *value, size_t size)
 
void appendString (const char *name, const SkString &value)
 
template<class T , std::enable_if_t< std::is_same_v< T, std::string >, bool > = false>
void appendString (const char *name, const T &value)
 
template<size_t N>
void appendNString (const char *name, char const (&value)[N])
 
void appendCString (const char *name, const char *value)
 
void appendFloatDigits (const char *name, float value, int digits)
 
void appendDoubleDigits (const char *name, double value, int digits)
 

Additional Inherited Members

- Public Types inherited from SkJSONWriter
enum class  Mode { kFast , kPretty }
 

Detailed Description

NanoJSONResultsWriter helps nanobench writes the test results out in the following format:

{ "key": { "arch": "Arm7", "gpu": "SGX540", "os": "Android", "model": "GalaxyNexus", } "gitHash": "d1830323662ae8ae06908b97f15180fd25808894", "build_number": "1234", "results" : { "Xfermode_Luminosity_640_480" : { "8888" : { "median_ms" : 143.188128906250, "min_ms" : 143.835957031250, ... }, ...

Definition at line 39 of file ResultsWriter.h.

Constructor & Destructor Documentation

◆ NanoJSONResultsWriter()

NanoJSONResultsWriter::NanoJSONResultsWriter ( SkWStream stream,
Mode  mode 
)
inline

Definition at line 41 of file ResultsWriter.h.

SkJSONWriter(SkWStream *stream, Mode mode=Mode::kFast)
Definition: SkJSONWriter.h:57
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

Member Function Documentation

◆ appendMetric()

void NanoJSONResultsWriter::appendMetric ( const char *  name,
double  value 
)
inline

Definition at line 50 of file ResultsWriter.h.

50 {
51 // Don't record if NaN or Inf.
52 if (std::isfinite(value)) {
53 this->appendDoubleDigits(name, value, 16);
54 }
55 }
void appendDoubleDigits(double value, int digits)
Definition: SkJSONWriter.h:247
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
SINT bool isfinite(const Vec< N, T > &v)
Definition: SkVx.h:1003

◆ beginBench()

void NanoJSONResultsWriter::beginBench ( const char *  name,
int32_t  x,
int32_t  y 
)
inline

Definition at line 43 of file ResultsWriter.h.

43 {
44 SkString id = SkStringPrintf("%s_%d_%d", name, x, y);
45 this->beginObject(id.c_str());
46 }
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
void beginObject(const char *name=nullptr, bool multiline=true)
Definition: SkJSONWriter.h:114
double y
double x

◆ endBench()

void NanoJSONResultsWriter::endBench ( )
inline

Definition at line 48 of file ResultsWriter.h.

48{ this->endObject(); }
void endObject()
Definition: SkJSONWriter.h:126

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