NUGU SDK Linux  1.7.6
Profiling

Profiling functions. More...

+ Collaboration diagram for Profiling:

Classes

struct  nugu_prof_data
 Profiling raw data. More...
 

Typedefs

typedef void(* NuguProfCallback) (enum nugu_prof_type type, const struct nugu_prof_data *data, void *userdata)
 Callback prototype for receiving an attachment. More...
 

Enumerations

enum  nugu_prof_type {
  NUGU_PROF_TYPE_SDK_CREATED , NUGU_PROF_TYPE_SDK_PLUGIN_INIT_START , NUGU_PROF_TYPE_SDK_PLUGIN_INIT_DONE , NUGU_PROF_TYPE_SDK_INIT_DONE ,
  NUGU_PROF_TYPE_NETWORK_CONNECT_REQUEST , NUGU_PROF_TYPE_NETWORK_REGISTRY_REQUEST , NUGU_PROF_TYPE_NETWORK_REGISTRY_RESPONSE , NUGU_PROF_TYPE_NETWORK_REGISTRY_FAILED ,
  NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_REQUEST , NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_RESPONSE , NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_FAILED , NUGU_PROF_TYPE_NETWORK_CONNECTED ,
  NUGU_PROF_TYPE_NETWORK_DIRECTIVES_CLOSED , NUGU_PROF_TYPE_NETWORK_DNS_FAILED , NUGU_PROF_TYPE_NETWORK_SSL_FAILED , NUGU_PROF_TYPE_NETWORK_TIMEOUT ,
  NUGU_PROF_TYPE_NETWORK_INTERNAL_ERROR , NUGU_PROF_TYPE_NETWORK_INVALID_TOKEN , NUGU_PROF_TYPE_NETWORK_PING_REQUEST , NUGU_PROF_TYPE_NETWORK_PING_RESPONSE ,
  NUGU_PROF_TYPE_NETWORK_PING_FAILED , NUGU_PROF_TYPE_NETWORK_EVENT_REQUEST , NUGU_PROF_TYPE_NETWORK_EVENT_RESPONSE , NUGU_PROF_TYPE_NETWORK_EVENT_FAILED ,
  NUGU_PROF_TYPE_NETWORK_EVENT_ATTACHMENT_REQUEST , NUGU_PROF_TYPE_NETWORK_EVENT_DIRECTIVE_RESPONSE , NUGU_PROF_TYPE_NETWORK_EVENT_DIRECTIVE_TIMEOUT , NUGU_PROF_TYPE_LAST_SERVER_INITIATIVE_DATA ,
  NUGU_PROF_TYPE_WAKEUP_KEYWORD_DETECTED , NUGU_PROF_TYPE_ASR_LISTENING_STARTED , NUGU_PROF_TYPE_ASR_RECOGNIZE , NUGU_PROF_TYPE_ASR_RECOGNIZING_STARTED ,
  NUGU_PROF_TYPE_ASR_END_POINT_DETECTED , NUGU_PROF_TYPE_ASR_TIMEOUT , NUGU_PROF_TYPE_ASR_FIRST_ATTACHMENT , NUGU_PROF_TYPE_ASR_LAST_ATTACHMENT ,
  NUGU_PROF_TYPE_ASR_RESULT , NUGU_PROF_TYPE_TTS_SPEAK_DIRECTIVE , NUGU_PROF_TYPE_TTS_FAILED , NUGU_PROF_TYPE_TTS_STARTED ,
  NUGU_PROF_TYPE_TTS_NET_FIRST_ATTACHMENT , NUGU_PROF_TYPE_TTS_FIRST_ATTACHMENT , NUGU_PROF_TYPE_TTS_FIRST_DECODING , NUGU_PROF_TYPE_TTS_FIRST_PCM_WRITE ,
  NUGU_PROF_TYPE_TTS_LAST_ATTACHMENT , NUGU_PROF_TYPE_TTS_STOPPED , NUGU_PROF_TYPE_TTS_FINISHED , NUGU_PROF_TYPE_AUDIO_STARTED ,
  NUGU_PROF_TYPE_AUDIO_FINISHED , NUGU_PROF_TYPE_MAX
}
 Profiling type list. More...
 

Functions

NUGU_API void nugu_prof_clear (void)
 clear all cached profiling data
 
NUGU_API void nugu_prof_disable_tracelog (void)
 turn off the profiling trace log message
 
NUGU_API void nugu_prof_dump (enum nugu_prof_type from, enum nugu_prof_type to)
 Dump the profiling data between 'from' type to 'to' type. More...
 
NUGU_API void nugu_prof_enable_tracelog (void)
 turn on the profiling trace log message
 
NUGU_API int nugu_prof_get_diff_msec (const struct nugu_prof_data *prof1, const struct nugu_prof_data *prof2)
 Get the time difference(prof2 - prof1) value in milliseconds. More...
 
NUGU_API int nugu_prof_get_diff_msec_timespec (const struct timespec *ts1, const struct timespec *ts2)
 Get the time difference(ts2 - ts1) value in milliseconds. More...
 
NUGU_API int nugu_prof_get_diff_msec_type (enum nugu_prof_type type1, enum nugu_prof_type type2)
 Get the time difference(ts2 - ts1) value in milliseconds. More...
 
NUGU_API struct nugu_prof_datanugu_prof_get_last_data (enum nugu_prof_type type)
 Get last cached data by profiling type. More...
 
NUGU_API const char * nugu_prof_get_type_name (enum nugu_prof_type type)
 Get string type name for profiling type. More...
 
NUGU_API int nugu_prof_mark (enum nugu_prof_type type)
 Marking to profiling data and emit the callback. More...
 
NUGU_API int nugu_prof_mark_data (enum nugu_prof_type type, const char *dialog_id, const char *msg_id, const char *contents)
 Marking to profiling data with additional id and emit the callback. More...
 
NUGU_API void nugu_prof_set_callback (NuguProfCallback callback, void *userdata)
 Set profiling callback. More...
 

Detailed Description

Profiling functions.

The profiling module provides notification and performance measurement for each condition.

Typedef Documentation

◆ NuguProfCallback

typedef void(* NuguProfCallback) (enum nugu_prof_type type, const struct nugu_prof_data *data, void *userdata)

Callback prototype for receiving an attachment.

See also
nugu_prof_set_callback()

Enumeration Type Documentation

◆ nugu_prof_type

Profiling type list.

See also
nugu_prof_mark()
nugu_prof_mark_data()
nugu_prof_get_last_data()
Enumerator
NUGU_PROF_TYPE_SDK_CREATED 

SDK created. timestamp baseline

NUGU_PROF_TYPE_SDK_PLUGIN_INIT_START 

Plugin loading and init start

NUGU_PROF_TYPE_SDK_PLUGIN_INIT_DONE 

All plugin initialized

NUGU_PROF_TYPE_SDK_INIT_DONE 

SDK initialized and ready

NUGU_PROF_TYPE_NETWORK_CONNECT_REQUEST 

Network manager connect

NUGU_PROF_TYPE_NETWORK_REGISTRY_REQUEST 

HTTP/2 Request for GET /v1/policies

NUGU_PROF_TYPE_NETWORK_REGISTRY_RESPONSE 

HTTP/2 Response for GET /v1/policies

NUGU_PROF_TYPE_NETWORK_REGISTRY_FAILED 

HTTP/2 Failed for GET /v1/policies

NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_REQUEST 

HTTP/2 Request for GET /v2/directives

NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_RESPONSE 

HTTP/2 long polling established for /v2/directives

NUGU_PROF_TYPE_NETWORK_SERVER_ESTABLISH_FAILED 

HTTP/2 Failed for GET /v2/directives

NUGU_PROF_TYPE_NETWORK_CONNECTED 

Network manager connected

NUGU_PROF_TYPE_NETWORK_DIRECTIVES_CLOSED 

HTTP/2 /v2/directives stream closed by server

NUGU_PROF_TYPE_NETWORK_DNS_FAILED 

Network DNS Resolving failed

NUGU_PROF_TYPE_NETWORK_SSL_FAILED 

Network SSL failed

NUGU_PROF_TYPE_NETWORK_TIMEOUT 

Network timeout

NUGU_PROF_TYPE_NETWORK_INTERNAL_ERROR 

Network internal error

NUGU_PROF_TYPE_NETWORK_INVALID_TOKEN 

Invalid token

NUGU_PROF_TYPE_NETWORK_PING_REQUEST 

HTTP/2 Request for GET /v2/ping

NUGU_PROF_TYPE_NETWORK_PING_RESPONSE 

HTTP/2 Response for GET /v2/ping

NUGU_PROF_TYPE_NETWORK_PING_FAILED 

HTTP/2 Failed for GET /v2/ping

NUGU_PROF_TYPE_NETWORK_EVENT_REQUEST 

HTTP/2 Request for POST /v2/events

NUGU_PROF_TYPE_NETWORK_EVENT_RESPONSE 

HTTP/2 Response for POST /v2/events

NUGU_PROF_TYPE_NETWORK_EVENT_FAILED 

HTTP/2 Failed for POST /v2/events

NUGU_PROF_TYPE_NETWORK_EVENT_ATTACHMENT_REQUEST 

HTTP/2 Request for POST /v2/events attachment

NUGU_PROF_TYPE_NETWORK_EVENT_DIRECTIVE_RESPONSE 

HTTP/2 Directive response for POST /v2/events

NUGU_PROF_TYPE_NETWORK_EVENT_DIRECTIVE_TIMEOUT 

HTTP/2 Directive timeout for POST /v2/events

NUGU_PROF_TYPE_LAST_SERVER_INITIATIVE_DATA 

Last received data from /v2/directives

NUGU_PROF_TYPE_WAKEUP_KEYWORD_DETECTED 

Wakeup keyword detected

NUGU_PROF_TYPE_ASR_LISTENING_STARTED 

ASR listening started

NUGU_PROF_TYPE_ASR_RECOGNIZE 

ASR.Recognize event

NUGU_PROF_TYPE_ASR_RECOGNIZING_STARTED 

ASR recognizing started

NUGU_PROF_TYPE_ASR_END_POINT_DETECTED 

ASR end point detected

NUGU_PROF_TYPE_ASR_TIMEOUT 

ASR listening timeout

NUGU_PROF_TYPE_ASR_FIRST_ATTACHMENT 

ASR first attachment

NUGU_PROF_TYPE_ASR_LAST_ATTACHMENT 

ASR last attachment

NUGU_PROF_TYPE_ASR_RESULT 

ASR result received

NUGU_PROF_TYPE_TTS_SPEAK_DIRECTIVE 

TTS.Speak directive received

NUGU_PROF_TYPE_TTS_FAILED 

TTS play failed

NUGU_PROF_TYPE_TTS_STARTED 

TTS started

NUGU_PROF_TYPE_TTS_NET_FIRST_ATTACHMENT 

TTS receive first attachment in network module

NUGU_PROF_TYPE_TTS_FIRST_ATTACHMENT 

TTS receive first attachment

NUGU_PROF_TYPE_TTS_FIRST_DECODING 

TTS decoding for first attachment

NUGU_PROF_TYPE_TTS_FIRST_PCM_WRITE 

TTS PCM write

NUGU_PROF_TYPE_TTS_LAST_ATTACHMENT 

TTS receive last attachment

NUGU_PROF_TYPE_TTS_STOPPED 

TTS stopped

NUGU_PROF_TYPE_TTS_FINISHED 

TTS finished

NUGU_PROF_TYPE_AUDIO_STARTED 

AudioPlayer started

NUGU_PROF_TYPE_AUDIO_FINISHED 

AudioPlayer finished

NUGU_PROF_TYPE_MAX 

Just last value

Function Documentation

◆ nugu_prof_set_callback()

NUGU_API void nugu_prof_set_callback ( NuguProfCallback  callback,
void *  userdata 
)

Set profiling callback.

Parameters
[in]callbackcallback function
[in]userdatadata to pass to the user callback

◆ nugu_prof_mark()

NUGU_API int nugu_prof_mark ( enum nugu_prof_type  type)

Marking to profiling data and emit the callback.

Parameters
[in]typeprofiling type
Returns
result
Return values
0success
-1failure

◆ nugu_prof_mark_data()

NUGU_API int nugu_prof_mark_data ( enum nugu_prof_type  type,
const char *  dialog_id,
const char *  msg_id,
const char *  contents 
)

Marking to profiling data with additional id and emit the callback.

Parameters
[in]typeprofiling type
[in]dialog_iddialog request id
[in]msg_idmessage id
[in]contentsadditional contents
Returns
result
Return values
0success
-1failure

◆ nugu_prof_get_last_data()

NUGU_API struct nugu_prof_data* nugu_prof_get_last_data ( enum nugu_prof_type  type)

Get last cached data by profiling type.

Parameters
[in]typeprofiling type
Returns
memory allocated nugu_prof_data struct. developer must free the data.

◆ nugu_prof_get_diff_msec_timespec()

NUGU_API int nugu_prof_get_diff_msec_timespec ( const struct timespec *  ts1,
const struct timespec *  ts2 
)

Get the time difference(ts2 - ts1) value in milliseconds.

Parameters
[in]ts1time value
[in]ts2time value
Returns
milliseconds

◆ nugu_prof_get_diff_msec_type()

NUGU_API int nugu_prof_get_diff_msec_type ( enum nugu_prof_type  type1,
enum nugu_prof_type  type2 
)

Get the time difference(ts2 - ts1) value in milliseconds.

Parameters
[in]type1profiling type
[in]type2profiling type
Returns
milliseconds

◆ nugu_prof_get_diff_msec()

NUGU_API int nugu_prof_get_diff_msec ( const struct nugu_prof_data prof1,
const struct nugu_prof_data prof2 
)

Get the time difference(prof2 - prof1) value in milliseconds.

Parameters
[in]prof1time value
[in]prof2time value
Returns
milliseconds

◆ nugu_prof_get_type_name()

NUGU_API const char* nugu_prof_get_type_name ( enum nugu_prof_type  type)

Get string type name for profiling type.

Parameters
[in]typeprofiling type
Returns
NULL terminated string

◆ nugu_prof_dump()

NUGU_API void nugu_prof_dump ( enum nugu_prof_type  from,
enum nugu_prof_type  to 
)

Dump the profiling data between 'from' type to 'to' type.

Parameters
[in]fromstart type to dump
[in]toend type to dump