Home

Traffic Server Software Developers Kit

Statistics Functions

Uncoupled Statistics

INKStatFloatGet

Obtains the value of a float statistic.

Prototype

INKReturnCode INKStatFloatGet(INKStat stat, float *value)

Returns

INK_SUCCESS if the API is called successfully.

INK_ERROR if an error occurs while calling the API or if an argument is invalid.

INKStatIntGet

Obtains the value of an integer statistic.

Prototype

INKReturnCode INKStatIntGet(INKStat stat, INK64 *value)

Returns

INK_SUCCESS if the API is called successfully.

INK_ERROR if an error occurs while calling the API or if an argument is invalid.

INKStatFloatAddTo

Adds a float value to a float statistic.

Prototype

INKReturnCode INKStatFloatAddTo ( INKStat the_stat, float amount)

Description

Adds a float value to a float statistic.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.

INKStatIntAddTo

Adds an INK64 value to an integer statistic.

Prototype

INKReturnCode INKStatIntAddTo ( INKStat the_stat, INK64 amount)

Description

Adds an INK64 value to an integer statistic.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.

INKStatCreate

Creates a new INKStat.

Prototype

INKStat INKStatCreate ( const char * the_name, INKStatTypes the_type)

Description

Creates a new INKStat. The value pointed to by the_name is the name you use to view the statistic using Traffic Line (see Viewing Statistics Using Traffic Line). There are two INKStatTypes: INKSTAT_TYPE_INT64 and INKSTAT_TYPE_FLOAT.

Returns

A handle to the newly-created INKStat.

INK_ERROR_PTR if an error occurs.

INKStatDecrement

Decrements a stat.

Prototype

INKReturnCode INKStatDecrement(INKStat the_stat )

Description

Decrements a stat.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.

INKStatIncrement

Increments a stat.

Prototype

INKReturnCode INKStatIncrement(INKStat the_stat )

Description

Increments a statistic.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.

INKStatFloatSet

Sets the value of a float stat to a particular value.

Prototype

INKReturnCode INKStatFloatSet(INKStat the_stat, float the_value )

Description

Sets the value of a float stat to the specified value.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.

INKStatIntSet

Sets the value of an integer stat to a particular value.

Prototype

INKReturnCode INKStatIntSet(INKStat the_stat, INK64 the_value )

Description

Sets the value of a integer stat to a particular value.

Returns

INK_SUCCESS if the operation completes successfully.

INK_ERROR if an error occurs.