Class: kb.Statistics

Defined in: src/knockback-statistics/knockback-statistics.coffee

Overview

kb.Statistics is an optional components that is useful for measuring your application's performance. You can record all of the Backbone.Events that have triggered ko.observable subscription updates and the memory footprint (instance count-only) of your ViewModels and collection observables.

kb.Statistics is not included in knockback.js nor knockback-core.js so you need to manually include it from the lib directory.

Instance Method Summary

Constructor Details

- (void) constructor()

Instance Method Details

- (void) clear()

Clear the tracked model events (but keep the registered objects intact)

- (void) addModelEvent(event)

Register a model event

- (void) modelEventsStatsString()

A debug helper to summarize the registered events in human-readable form

- (void) register(key, obj)

Register an object by key

- (void) unregister(key, obj)

Unregister an object by key

- (Integer) registeredCount(type)

Returns:

  • (Integer) — the number of registered objects by type

- (String) registeredStatsString(success_message)

A debug helper to summarize the current registered objects by key

Parameters:

  • success_message (String) a message to return if there are no registered objects

Returns:

  • (String) — a human readable string summarizing the currently registered objects or success_message