Metrics (Windows Performance Counters)
Logs say what an application reported; metrics show what the machine and its processes were doing at the same time - CPU, memory, disk, a process’s private bytes, threads or handles. TKTail reads them from Windows Performance Counters and shows them beside your logs on the same clock, so an ERROR at 14:32:07 can be compared with the CPU and memory of 14:32:07.
- Nothing is collected until you choose counters. Browsing the list of counters samples nothing.
- History is kept in memory only - the last 15 minutes by default (5, 15, 30 or 60) - and starts when a counter is first collected: there are no metrics for earlier times. Nothing is written to disk.
- Metrics need a Trial, Pro or Developer license. Without one the commands stay in the menus, marked (Pro), and explain this when chosen; the log viewer works as before.
Opening metrics
View > Metrics… opens the counter picker (Metrics - Windows Performance Counters). The quickest way is a Metric Set - a saved selection of counters, built once and reopened in seconds:
- Choose a set in Metric Set at the top - a built-in one or one of yours.
- Load puts its counters into Selected (nothing is collected yet). A set that observes a process, a disk or a network interface asks which one first.
- Adjust the selection (and the colors) if you like, then Open (or Add - see below).
With nothing selected, Open applies the chosen set at once. Host Basics and Process Diagnostics… at the bottom do the same in one click.
Built-in Metric Sets (shipped with TKTail; they cannot be changed or deleted - Save As makes your own copy):
| Set | Counters | Asks for |
|---|---|---|
| Host Basics | CPU (total), available memory, committed memory, disk throughput | - |
| System Pressure | CPU (total), processor queue length, available memory, committed memory, paging (pages/s), context switches | - |
| Process Diagnostics | the process’s CPU (a share of the machine, as Task Manager shows it), private bytes, working set, threads, handles, I/O throughput | a process |
| Disk & I/O | read / write throughput, reads / writes per second, read / write latency, queue length | a disk (all disks preselected) |
| Network | bytes total / received / sent per second, packets per second | a network interface |
Choosing the process (Process Diagnostics, Choose Process): the running processes are listed; type to filter. Follow by name continues the series when the process restarts (the restart is marked); Pin this process watches exactly that PID - the series ends when it exits. A name you type that is not running yet is followed by name and collected when it starts.
Picking counters yourself: an Object (Processor Information, Memory, Process, …), one or more Counters and, where the object has them, Instances (Ctrl / Shift for several). Names appear in this Windows’s language, in English or both (Show names - see Counter names below); Find matches either, whichever is shown - Private Bytes finds Bajty prywatne on a Polish Windows. Add to Selection (or double-click a counter or an instance) puts them into Selected; with nothing in Selected, Open takes what the lists show.
Selected lists every counter with its Color (a swatch: Auto or yours - click it to change it) and its State: available, not running now (a process followed by name - collected when it starts), unresolved (pinned to a PID that is gone - select it and use Choose Process to bind it to a running process), or not on this computer (the counter, its object or its instance does not exist here - another computer may have it; it stays in the set and is simply not collected). Remove (Delete) and Clear Selection change the selection only, never a saved set.
Your own Metric Sets:
- Save As… keeps the selection as a new set with a name and an optional description - for example Qlik Server Diagnostics: CPU, available memory, disk throughput and the engine process’s CPU, private bytes and threads. Next time: View > Metrics…, choose it, Open.
- Save writes the changed selection and its colors back into the loaded set (a set with unsaved
changes shows
*after its name above the selection). A built-in set is never saved over. - Manage…: Revert to Saved (the loaded set’s counters and colors again), Rename, Duplicate, Delete (with a confirmation), Open Metric Sets Folder.
- Your sets are listed under My Metric Sets, below the built-in ones. They are stored by their English counter names, so they work on another computer and in another Windows language (see Counter names); a process, disk or interface that does not exist there shows as unavailable or unresolved.
The picker can be resized and maximized - the three lists share the extra width, the selection the extra height - and a name that does not fit shows in full in a tooltip. TKTail remembers its size and position (on a monitor that still exists).
The counters open in a new Metrics View tab named after the set (Metrics: Host Basics, Metrics: PaymentService, Metrics: Qlik Server Diagnostics). If a Metrics View is the active tab, the picker’s button says Add and adds to it instead. The same entries are in Tools > Metrics (Open Metrics: Host Basics, Open Metrics: Process Diagnostics…, Add Counters…), and the SYSTEM panel has a Metrics button. Tools > Metrics > Open Metric Set… lists the built-in sets and yours and opens one directly.
Counter names
Windows names its counters in its own language: Bajty prywatne on a Polish Windows is Private Bytes on an English one. TKTail shows them the way you choose - System language (the default), English, or System language + English (Bajty prywatne [Private Bytes], handy when you follow English documentation). Choose it in the picker (Show names), in Tools > Metrics > Counter Names, or from the right-click menu of a Metrics View or the METRICS panel; every open view follows at once. It changes only the names you see - the counters, their history and your sets stay as they are.
Hover a series name in a Metrics View, a row of the METRICS panel or an entry in the picker for both names and the counter path. Labels of the built-in sets (CPU (total), Available memory) are TKTail’s own names and stay the same in every form. Process, disk and interface names (the instances) are names of things, never translated. A provider that has no English names keeps its own and says so.
To give a series a name of your own - Qlik Engine RAM for a process’s private bytes - right-click it > Series Name… (in a Metrics View, or on a row of Selected in the picker). The name is saved with the Metric Set, like its color; leave it empty to go back to the counter’s name.
Your sets on another computer. A Metric Set keeps the language-neutral identity of every counter (the English name, and the GUID where Windows has one), never the names of your Windows’s language. Made on a Polish Windows, it opens on an English one with the same counters - shown in English there; a counter that computer does not have shows as not on this computer.
The Metrics View
A Metrics View is a tab like a log: it can be split, moved and shown next to logs. Each counter gets a lane on one shared time axis: its name and current value, and the minimum, average, maximum and change of what is visible (or of the selected range). Series of different units never share a scale. A gap in collection is drawn as a gap, a sample that could not be read is marked below the line, and no earlier data marks the time before collection started.
The header shows LIVE / PAUSED, the zoom (30 s to 60 min), the cursor or range, and how often the view collects. The tab names what it shows (Metrics: Host Basics, Metrics: Host Basics + PaymentService, Metrics: 9 counters) and follows when you add or remove counters.
| Action | How |
|---|---|
| Pause / go live | Click LIVE in the header, Space, Shift+F5 / F5, or End (go live). Pausing stops the display only - collection continues |
| Time cursor | Click in a chart; the values at that time are what Ctrl+C copies |
| Select a range | Drag in a chart (the view pauses); its statistics show in every lane; Esc clears cursor and range |
| Move in time | Mouse wheel (up = older), Left / Right (Ctrl: further), Home (the oldest kept) |
| Zoom | The zoom buttons in the header, Ctrl+wheel, + / - |
| Many lanes | Shift+wheel or the scroll bar; Up / Down select a series |
Right-click the view for: Search Logs and Events in This Range… (below), Copy the Values / Copy the Range’s Statistics, One Lane per Unit (series of one unit together), Fit Percent Lanes to Their Data, Series Color (below), Hide the Selected Series / Show All Series, Remove the Selected Series, Add Counters…, Collect Every 1 / 2 / 5 / 10 / 30 s, and the Metric Set commands (below).
Series colors
Every series starts in Auto: a color of TKTail’s palette, by its place in the view - the same set opens with the same colors, and series sharing a lane never get the same one. To give a series a color of its own, right-click its name (or its lane) > Series Color and pick one of the ten preset colors, Custom… (the Windows color dialog) or Auto to go back; Reset All Series to Auto is at the end of that menu. In the picker, click a row’s swatch in Selected (or right-click the row) for the same choices before you open the set.
A color only changes how the series is drawn - the counter, its history and its collection stay as they are. A chosen color stays yours in both themes; one too close to the background (yellow on white) gets a thin outline instead of being replaced. Colors tell series apart; states never depend on them alone (warming up, missing and errors are drawn as patterns and named in the lane).
Saving a view as a Metric Set
What a Metric Set remembers: its counters in their order, the process / disk / interface they observe, each series’ color (Auto or yours) and One Lane per Unit. What it never remembers: the zoom, the cursor or range, LIVE / PAUSED, hidden series - those belong to the open view.
- Save as Metric Set… keeps the view as a new set (name, optional description); the view belongs to that set from then on.
- A view opened from one of your sets shows
*on its tab once its counters, colors or lanes differ from the set. Save to “<set>” writes them back; Revert to Saved Set brings the set’s counters and colors back. - A view of a built-in set (Host Basics, …) is never saved over: Save as Metric Set… makes your own copy, for example My Host Basics with CPU in red.
Two sets of the same counters open as two tabs, each with its own colors - and still one collection per counter.
The status bar shows LIVE / PAUSED, the cursor or range, how many metrics the view collects and how often (the tooltip adds the collection’s memory and its last duration).
Logs and metrics side by side
From a log to metrics. Right-click a record (or an event in an event tab) > Show Metrics Around This Time (also Tools > Metrics). TKTail opens a Metrics View beside the log, paused on that record’s time with the cursor on it - or moves a Metrics View already shown beside it. The new view shows the METRICS panel’s counters, or Host Basics when that list is empty. Records need a complete date and time; a time older than the history kept says so.
From metrics to logs. Drag a range in a Metrics View (for example a CPU spike), right-click > Search Logs and Events in This Range…: the Advanced Search opens in the bottom panel with that time range and the open files and event logs as sources. Choose what to look for, then Search. With only a cursor, the search covers the 30 seconds before and after it.
The METRICS panel
View > Tool Views > Metrics (or Tools > Metrics > METRICS Panel) shows a table of every counter being collected: its current value, minimum / average / maximum and a sparkline of the last 5 minutes, its state, and which views collect it (Collected for).
The panel has its own list too: counters you add here are collected from TKTail’s start for as long as they stay on the list (it is saved with your settings) - useful for “always show me CPU and the service’s memory”. The panel’s buttons and right-click menu: Add counters (+ - the picker with its Metric Sets), Add Host Basics, Add Process Diagnostics…, Open in New Metrics View (Enter), Pause the display, Remove (Delete), Remove Stopped Metrics, Copy, Collect Every, and Keep History 5 / 15 / 30 / 60 minutes (for all metrics).
From the panel into a Metrics View. Select one or several rows (Ctrl+click, Shift+click, Ctrl+A) and:
- right-click > Add to Active Metrics View - the Metrics View in front, else the one you used last, else a new one;
- right-click > Add to Metrics View > one of the open Metrics Views, or New Metrics View;
- Open in New Metrics View (Enter) - a view of just those metrics;
- or drag the rows: onto a Metrics View they join it; onto a log pane, an empty area or a pane’s edge they open in a new Metrics View there (Drag sources into the workspace).
A metric that is in the view already is not added twice (it is selected instead), and the view keeps
collecting through the same stream - adding a view never starts a second collection of a counter,
and the history TKTail kept is shown at once. A stopped (history kept) metric can be added too: the
view shows its history and its state, never a value it does not have. Where the new series is drawn
follows the view: with One Lane per Unit it joins the lane of its unit, otherwise it gets a lane
of its own - a value never lands on another unit’s axis (the status bar says which while you drag).
The rows stay selected, so the next view is one more click. Adding to a view opened from one of your
Metric Sets marks it changed (*): Save to “<set>” keeps the change, Revert to Saved Set
undoes it; a built-in set never changes - Save as Metric Set… makes it yours.
Removing metrics. Select one or several rows - Ctrl+click, Shift+click, Ctrl+A - and press Delete (or right-click > Remove Metrics; a right-click on a selected row keeps the selection). The selection stays on the same metrics while the table updates every second.
- A counter on the panel’s own list leaves it.
- A stopped metric (stopped (history kept) - for example the counters of a process whose view you closed) is removed with its history; Remove Stopped Metrics does that for all of them.
- A metric a Metrics View still collects stays for that view (the status bar names it) - remove it in the view, or close the view.
Removing rows never changes a saved Metric Set: open the set again and its counters come back.
| State | Meaning |
|---|---|
| ok | Read at the last collection |
| waiting for the first sample | Nothing has been read yet |
| warming up | Rates (CPU, bytes/s) need two readings - the first value comes one interval later |
| stale | No new sample for longer than expected |
| restarted (another process) | A followed process was restarted; the series continues, marked |
| not running | The process (the counter’s instance) is not running now |
| access denied | Windows does not let this user read the counter |
| unavailable | The counter cannot be read now (the tooltip says why) |
| stopped (history kept) | Nothing collects it any more; what was collected stays until it ages out |
Linked windows
The METRICS panel’s own list is collected once, by the main window; a linked window says so in its panel and Open in Metrics View shows the list there. Metrics Views opened in a linked window collect in that window. See Linked windows.
What it costs
Counters are read on a background thread, once per interval for all views together - three views of the same counter are one collection. A hidden Metrics View does not draw; a visible one draws when new samples arrive.
What matters is which kind of counter, not how many: Windows reads a whole counter object at a time. Processor, memory and disk counters (Host Basics) cost next to nothing. Counters of the Process object (Process Diagnostics, any process counter) and of the System object (System Pressure’s queue length and context switches) make Windows gather the list of all running processes at every collection, so their cost grows with how busy the PC is - measured from about 4 ms of CPU time per collection (450 processes) to about 60 ms (820 processes with 38,000 threads), i.e. from under 1 % to about 6 % of one CPU core at every 1 s, the same for one or twenty such counters. When you watch process counters for longer on a busy PC, Collect Every 2-5 s lowers that in proportion. A hidden Metrics View costs nothing; a visible one redraws once per collection. Measured numbers: PERFORMANCE.md.