{"id":22180736,"url":"https://github.com/jftuga/flash_read_cache_stats","last_synced_at":"2026-06-25T03:31:35.794Z","repository":{"id":117699134,"uuid":"148515209","full_name":"jftuga/flash_read_cache_stats","owner":"jftuga","description":"View stats from ESX's Flash Read Cache using Grafana and InfluxDB","archived":false,"fork":false,"pushed_at":"2018-09-12T19:57:43.000Z","size":162,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T20:24:55.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-12T17:15:24.000Z","updated_at":"2024-11-09T18:35:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebf5562b-4fec-46fd-919d-983d70e75941","html_url":"https://github.com/jftuga/flash_read_cache_stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jftuga/flash_read_cache_stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fflash_read_cache_stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fflash_read_cache_stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fflash_read_cache_stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fflash_read_cache_stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/flash_read_cache_stats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fflash_read_cache_stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34758773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T09:19:28.714Z","updated_at":"2026-06-25T03:31:35.776Z","avatar_url":"https://github.com/jftuga.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Flash Read Cache Stats\r\n\r\nView statistics from ESX's Flash Read Cache using Granfana and InfluxDB\r\n\r\nThis is a method to save (long-term) and view statistics for the vSphere Flash Read Cache. It was tested against ESX 6.7.  This was a short lived project as we will now be using third-party caching software, but I wanted to throw something up on GitHub while it is still fresh in my memory.\r\n\r\nThe idea is to run `flash_cache_stats.ps` continuously. It will query all esx hosts defined by `$vcenter_server` for flash cache statistics.  The powershell script queries the hosts every `$run_interval` minutes. I recommend not setting this below 2 minutes for 3 hosts.  The more hosts and VMs you have, the longer time interval you should use.  \r\n\r\nAfter statictics are collected, they are stored in the `$influxdb_measurement` InfluxDB measurement table.  Other settings for your InfluxDB server are stored in `influxdb_config.json`\r\n\r\n_____\r\n\r\nEdit these settings in `flash_cache_stats.ps1`\r\n\r\n- $vcenter_server\r\n- $run_interval\r\n- $influxdb_measurement\r\n\r\nEdit these settings in `influxdb_config.json`\r\n\r\n- host\r\n- port\r\n- name (this is the name of the InfluxDB database)\r\n\r\n\r\nEdit `grafana_vm_template.json` (this is for Grafana)\r\n\r\n- replace `vfc-IDNUM-GUEST` with the cache name, as returned by this command: `esxcli storage vflash cache list`\r\n- replace `VMNAME` with the VM name\r\n- replace `INFLUXMEASUREMENT` with the name of your influxdb measurement table, eg: `$influxdb_measurement`\r\n\r\n_____\r\n\r\n# To get started\r\n\r\n- Install the VMware PowerCLI by running: `Install-Module -Name VMware.PowerCLI`\r\n- Run `flash_cache_stats.ps1` for about 10 minutes in order to get data into influxdb\r\n- Verify that results are being saved into the database:\r\n\r\n```sql\r\nuse vmware\r\n-- or whatever you named your database; see the 'db' setting in the influxdb_config.json\r\n\r\nSELECT count(MeandiskIOlatencyinmicroseconds) FROM XXX WHERE (\"namespace\" = 'Read' ) AND time \u003e= now() - 120m\r\n-- where XXX is the name of your measurement table, $influxdb_measurement\r\n```\r\n\r\n- This should return a count result greater than 0\r\n- Edit your Granfana's InfluxDB data source\r\n- Import your edited `grafana_vm_template.json` file into your Grafana instance\r\n- Once configured, you should be able to see results in Grafana\r\n- Example graphs: https://raw.githubusercontent.com/jftuga/flash_read_cache_stats/master/grafana_example.png\r\n\r\n____\r\n\r\nExample CLI output:\r\n\r\n```\r\n   [root@esx1:~] esxcli storage vflash cache stats get -c vfc-3111222333-SVRFILE02 \r\n   Read:\r\n         Cache hit rate (as a percentage): 12\r\n         Total cache I/Os: 167190\r\n         Mean cache I/O latency (in microseconds): 307\r\n         Mean disk I/O latency (in microseconds): 12248\r\n         Total I/Os: 1436803\r\n         Mean IOPS: 183\r\n         Max observed IOPS: 212\r\n         Mean number of KB per I/O: 170\r\n         Max observed number of KB per I/O: 9842\r\n         Mean I/O latency (in microseconds): 5455\r\n         Max observed I/O latency (in microseconds): 7078\r\n   Evict:\r\n         Last I/O operation time (in microseconds): 0\r\n         Number of I/O blocks in last operation: 0\r\n         Mean blocks per I/O operation: 0\r\n   Cache usage rate (as a percentage): 11\r\n   Total failed SSD I/Os: 0\r\n   Total failed disk I/Os: 0\r\n   Mean number of cache blocks in use: 1068360\r\n```\r\n\r\n- The InfluxDB measurement is structured in 3 namespaces: `Read, Evict and Global`.  The last 4 stats in the example output is saved in the `Global` namespace.\r\n\r\n____\r\n\r\nESX \u003c-\u003e PowerCLI mappings\r\n\r\n| esxcli output                              | PowerCLI                           | Example Value | \r\n|--------------------------------------------|------------------------------------|---------------| \r\n| Cache hit rate (as a percentage)           | Cachehitrateasapercentage          | 16            | \r\n| Max observed I/O latency (in microseconds) | MaxobservedIOlatencyinmicroseconds | 4154          | \r\n| Max observed IOPS                          | MaxobservedIOPS                    | 332           | \r\n| Max observed number of KB per I/O          | MaxobservednumberofKBperIO         | 7521          | \r\n| Mean I/O latency (in microseconds)         | MeanIOlatencyinmicroseconds        | 3511          | \r\n| Mean IOPS                                  | MeanIOPS                           | 284           | \r\n| Mean cache I/O latency (in microseconds)   | MeancacheIOlatencyinmicroseconds   | 111           | \r\n| Mean disk I/O latency (in microseconds)    | MeandiskIOlatencyinmicroseconds    | 8278          | \r\n| Mean number of KB per I/O                  | MeannumberofKBperIO                | 427           | \r\n| Total I/Os                                 | TotalIOs                           | 71525         | \r\n| Total cache I/Os                           | TotalcacheIOs                      | 11258         | \r\n| (TotalIOs - TotalcacheIOs)                 | TotaldiskIOs                       | 60267         | \r\n| Cache usage rate (as a percentage)         | Cacheusagerateasapercentage        | 7             | \r\n| Mean number of cache blocks in use         | Meannumberofcacheblocksinuse       | 89807         | \r\n\r\n____\r\n\r\nExample Graphs:\r\n\r\n![Flash Read Cache Stats Graphs](https://raw.githubusercontent.com/jftuga/flash_read_cache_stats/master/grafana_example.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fflash_read_cache_stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Fflash_read_cache_stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fflash_read_cache_stats/lists"}