Audit.Statistics
----------------

Queries statistics for [Audit](component_Audit.md) functions.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Audit](component_Audit.md) | [12.1](newinversion121.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Audit.Statistics" ) ### Parameters

none

### Result

Returns JSON or error.

### Description

Queries statistics for [Audit](component_Audit.md) functions.  
Values are returned as JSON.  
  
| Calls | Number of [Audit.Changed](AuditChanged.md), [Audit.Changed2](AuditChanged2.md), etc. calls. |
|---|---|
| Records | Number of records checked. |
| Fields | Number of fields checked. |
| InsertErrors | Number of times the Inserts to AuditLog table failed. |
| GetFieldErrors | Number of times calls to GetField() failed. |
| GetCountErrors | Number of times calls to Count() failed. |
| FieldTypeErrors | Number of times calls to FieldType() failed. |
| SelectValueErrors | Number of times calls to SELECT to get old value failed. |
| SchemaTables | Number of times schema got queried for tables. |
| SchemaFields | Number of times schema got queried for fields. |
| SchemaErrors | Number of errors related to schema queries. |

  
If things run normally, the error counts should be all zero. Calls should be higher than records.  
Since we cache schema information, the SchemaTables and SchemaFields numbers should not change except every few minutes.  
### See also

- [Audit.Changed](AuditChanged.md)
- [Audit.Changed2](AuditChanged2.md)

### Release notes

- **Version 12.2**
    - Added SchemaCacheFlushed counter for [Audit.Statistics](https://www.mbsplugins.eu/AuditStatistics.shtml) function to show how often we flushed the table cache.
- **Version 12.1**
    - Added [Audit.Statistics](https://www.mbsplugins.eu/AuditStatistics.shtml) function.

### Example Databases

- [Audit/Audit](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Audit/Audit.shtml#7ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 12.2pr1](https://www.mbsplugins.de/archive/2022-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-22/New_in_MBS_FileMaker_Plugin_12/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-15/Neues_MBS_FileMaker_Plugin_121/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.1 - More than 6700 Functions In One Plugin](https://www.mbsplugins.de/archive/2022-03-15/MBS_FileMaker_Plugin_121_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr6](https://www.mbsplugins.de/archive/2022-03-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 2nd March 2022 , last changed 2nd March 2022

  
[Audit.SetUUIDFields](AuditSetUUIDFields.md) - [Audit.TableIDForName](AuditTableIDForName.md)

[HTML Version](AuditStatistics.shtml)