Plugin session-2 Spec

 

Overview

This plugin covers the APIs in the following categories:

It does the following things:

  1. Create a thread and destroy it.
  2. Create three INKStat statistic variables transaction_count, session_count and avg_transactions and update them at every new session or transaction.
  3. Play with INKConfig family of functions to set and get config data.

Plugin Specification

In INKPluginInit(), the plugin creates a thread, waits for 5 seconds and destroys it. It creates three INKStat statistic variables: transaction_count, session_count and avg_transactions. It also creates a ConfigData with one element num_ssns and sets it to INKConfig. Then it registers a handler function for the global hook INK_HTTP_SSN_START_HOOK.

On INK_HTTP_SSN_START_HOOK, it increments the INKStat statistic variable session_count and num_ssns in INKConfig. Then it prints out both values. It adds a session hook INK_HTTP_TXN_START_HOOK.

The handler function on INK_HTTP_TXN_START_HOOK increments transaction_count and recalculates avg_transactions, then prints out both values.