Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
  typedef enum
    {
      TS_ERROR = -1,
      TS_SUCCESS = 0
    } TSReturnCode;

  typedef enum
    {
      TS_STAT_TYPE_INT = 1,
      // The following are currently not supported.
      TS_STAT_TYPE_FLOAT,
      TS_STAT_TYPE_STRING,
      TS_STAT_TYPE_COUNTER,
    } TSStatDataType;

  typedef enum
    {
      TS_STAT_PERSISTENT = 1,
      TS_STAT_NON_PERSISTENT
    } TSStatPersistence;

  typedef enum
    {
      TS_STAT_SYNC_SUM = 0,
      TS_STAT_SYNC_COUNT,
      TS_STAT_SYNC_AVG,
      TS_STAT_SYNC_TIMEAVG,
    } TSStatSync;

  inkapi int TSStatCreate(const char *the_name, TSStatDataType the_type, TSStatPersistence persist, TSStatSync sync);

  inkapi INKReturnCodeTSReturnCode TSStatIntIncrement(int the_stat, INK64 amount);
  inkapi INKReturnCodeTSReturnCode TSStatIntDecrement(int the_stat, INK64 amount);
  // Currently not supported.
  // inkapi INKReturnCodeTSReturnCode TSStatFloatIncrement(int the_stat, float amount);
  // inkapi INKReturnCodeTSReturnCode TSStatFloatDecrement(int the_stat, float amount);

  inkapi INKReturnCodeTSReturnCode TSStatIntGet(int the_stat, INK64* value);
  inkapi INKReturnCodeTSReturnCode TSStatIntSet(int the_stat, INK64 value);
  // Currently not supported
  // inkapi INKReturnCodeTSReturnCode TSStatFloatGet(int the_stat, float* value);
  // inkapi INKReturnCodeTSReturnCode TSStatFloatSet(int the_stat, float value);

  inkapi int TSStatFindName(const char* name);

...