Class ::ns::stats::SQLiteHistory

::ns::stats::SQLiteHistory[i] create ...

Defined in

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • mixinof: ::ns_stats[i]

Methods (to be applied on instances)

  • history configure (scripted, public)

     <instance of ns::stats::SQLiteHistory[i]> history configure \
        -pool pool  [ -retention retention ] [ -maxBytes maxBytes ]

    Validate the database pool and retention limits, initialize the schema and start a separate persistence callback. Repeated configuration with identical settings is harmless; changing active settings requires disabling persistence first. Return the resulting history status. Does not start sampling. Normalize retention to fractional seconds and maxBytes to bytes with ns_baseunit before validating the bounds.

    Switches:
    -pool (required)
    -retention (optional, defaults to "86400")
    -maxBytes (optional, defaults to "67108864")

    Testcases:
    No testcase defined.
  • history disable (scripted, public)

     <instance of ns::stats::SQLiteHistory[i]> history disable

    Stop future persistence callbacks without deleting stored history or stopping sampling. An outstanding write may finish. Return the resulting history status.

    Testcases:
    No testcase defined.
  • history query (scripted, public)

     <instance of ns::stats::SQLiteHistory[i]> history query -from from  \
        -to to  [ -server server ] [ -limit limit ] [ -cursor cursor ]

    Return stored samples, associated topology, paging information and coverage for an epoch interval. Queries run in the configuring virtual server and use an operation-local database handle. Historical server selection may include servers no longer active.

    Switches:
    -from (required, integer)
    -to (required, integer)
    -server (optional)
    -limit (optional, integer, defaults to "1000")
    -cursor (optional, integer, defaults to "0")

    Testcases:
    No testcase defined.
  • history save (scripted, public)

     <instance of ns::stats::SQLiteHistory[i]> history save

    Persist the latest published sample if history is enabled, no write is in progress and its timestamp has not already been saved. Claim the write under the shared coordination lock, then perform database operations outside that lock. Store the compressed sample and associated topology in one transaction, deduplicating samples by timestamp. Apply age and storage-budget eviction, retain coverage events and remove topology no longer referenced by retained samples. On failure, roll back the transaction, retain the pending sample for retry and update failure status. Repeated identical warnings are throttled. A subsequent successful write records the failed interval for coverage reporting. Release the database handle and clear the write claim on completion. Does not collect observations or advance the sampling baseline; callers inspect history status for the persistence outcome.

    Testcases:
    No testcase defined.
  • history status (scripted, public)

     <instance of ns::stats::SQLiteHistory[i]> history status

    Return shared history configuration and persistence status without opening the database. Internal coordination and cached topology fields are omitted.

    Testcases:
    No testcase defined.