<commit_before><commit_msg>Added readme for metrics<commit_after># GCSFuse Metrics
GCSFuse supports exporting custom metrics to Google cloud monitoring. 
Metrics are collected using OpenCensus and exported via Stackdriver exporter.

As of today, GCSFuse exports following metrics related to filesystem and
gcs calls.

## File system metrics:
* fs/ops_count: Cumulative number of operations processed by file system. It allows
grouping by op_type to get counts for individual operations. 
* fs/ops_error_count: Cumulative number of errors generated by file system operations.
Similar to fs/ops_count, this metric can also be grouped by op_type and error_type. 
* fs/ops_latency: Cumulative distribution of file system operation latencies. We 
can group by op_type.

## GCS metrics
* gcs/download_bytes_count: Cumulative number of bytes downloaded from GCS along
with read type. Read type specifies sequential or random read.
* gcs/read_bytes_count: Cumulative number of bytes read from GCS objects. This
is different from download_bytes_count. For eg: we might download x number of
bytes from GCS but read only <x bytes.
* gcs/reader_count: Cumulative number of GCS object readers opened or closed. We 
can group the data by IO Method type i.e., opened or closed. 
* gcs/request_count: Cumulative number of GCS requests processed. 
* gcs/request_latencies: Cumulative distribution of the GCS request latencies. 
* gcs/read_count: Specifies the count of gcs reads made along with read type. 
Read type specifies sequential or random read.

Note: Both request_count and request_latencies allows grouping by gcs method type.

# Usage
1. We need to set **stackdriver-export-interval** flag to enable exporting metrics to 
Google cloud monitoring. The value of this flag represents the interval with 
which data will be exported.

   Example command for exporting metrics every 60sec:
```angular2html
 gcsfuse --stackdriver-export-interval=60s <bucket_name> <directory_name>
```
2. Cloud monitoring api has to be [enabled](https://cloud.google.com/monitoring/api/enable-api) 
on the Google cloud project.
3. Service account with which the GCSFuse is running should have 
**monitoring.metricsDescriptors.create** permission.
4. For viewing the metrics:
    1. In the Google cloud console, go to **Metrics Explorer** page within **Monitoring**.
    2. In the toolbar, select the **Explorer** tab.
    3. Select the **configuration** tab.
    4. Expand the **Select a metric** menu. All the GCSFuse metrics will be under
   **Global > Custom > metric name**
    5. Example graph for fs/ops_count
![fs/ops_count](https://user-images.githubusercontent.com/101323867/188802087-6423f4f1-2aa6-4501-8db6-3d1997986f68.png)
{'fraction_non_alphanumeric': 0.06577974870657798, 'fraction_numerical': 0.020694752402069475, 'mean_word_length': 4.627858627858628, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3986497', 'n_tokens_mistral': 797, 'n_tokens_neox': 744, 'n_words': 339}