There are three main reasons for differences between values shown in Foglight and DB2 native commands:
1. How Data Is Collected:
- DB2 Command:
When you run `db2 get snapshot for database` after a `reset monitor`, the value you see (for example, "Lock waits = 94") is the total number of lock waits that have occurred since the last reset. - Foglight:
Foglight collects lock wait information at fixed intervals (for example, every 5–15 minutes) by polling the database using the `MON_GET_DATABASE` function. Each time it polls, it records the current cumulative value since the last reset.
2. How Data Is Displayed:
- DB2 Command:
The snapshot shows the total lock waits since the last reset. - Foglight:
In the UI, Foglight displays the values collected at each polling time. If you select a historical time range (for example, 12:00–13:00), Foglight will usually show the value from the last poll in that range (which should be the cumulative total since the last reset if there was no reset in between). If there is a problem with data collection or the agent, or if no data was collected (for example, due to retention policy), you may see a zero.
3. Retention Policy for Historical Data:
- By default, Foglight only keeps historical lock wait data for 3 days in the tables `DB2_History_Locks_Wait` and `DB2_Partition_History_Locks_Wait`.
- After 3 days, this data is automatically purged, so you cannot see or query lock wait history older than 3 days in the Foglight UI or reports.