<commit_before>Graphene
========

A highly saleable BI framwork writing in C#. Graphene can be used to track various Metrics. Graphene pre-aggregates the data and uses a document store (like MongoDB/RavenDB) to store the pre-aggregated data. Graphene also supports adding filters to a Metrics.


## Getting Started

### Initializing Graphene

Add the line below to your applications initialization event (e.g. ASP.Net: Application_Start event, Windows Service: OnStart)

```c#
Graphene.Configurator.Initialize(
                    new Configuration.Settings() { Persister = new Publishing.PersistToMongo("mongodb://localhost/Graphene") }
                );
```

### Creating a Tracker

A tracker is something of business value that needs to be tracked over time. Examples are number of order placed on a commerce site, the performance in MS of a given API etc. during a given time interval. 

To create a tracker implement Graphene.Tracking.ITrackable Interface

```c#
public class CustomerVisitTracker : ITrackable
{
	public string Name { get { return "Customer Visit Tracker"; } }

	public string Description { get { return "Counts the number of customer visits"; } }

	public Resolution MinResolution { get { return Resolution.Hour; } }
}
```

The MinResolution set the minimum time interval that can be tracked. If the interval is set to Hour then one can generate reports of that metrics per hour and above (day/month etc.) but not below that.

The higher the resolution the better Graphene can pre-compute the data and better the queries will perform. 

### Incrementing a Tracker

The line below increments the tracker by 1

```c#
Tracking.Container<CustomerVisitTracker>.IncrementBy(3);
```

### Adding filters

Filters can be added to allow the tracker data to be sliced and diced. For example number of orders placed from a given state or API performance on a given server. 

First step to adding a filter is to define it as a struct.

```c#
public struct CustomerFilter
{
	public string State { get; set; }
	public string StoreID { get; set; }
	public string Gender { get; set; }
	public string Environment_ServerName { get; set; }
}
```

All properties must be string or a nullable type. For Graphene's pre-computation to be optimal the cardinality of the filter values should be low, i.e. the all combination of the filter values should be
on the lower side for best performance.<commit_msg>Fixed typo<commit_after>Graphene
========

A highly saleable BI framwork writing in C#. Graphene can be used to track various Metrics. Graphene pre-aggregates the data and uses a document store (like MongoDB/RavenDB) to store the pre-aggregated data. Graphene also supports adding filters to a Metrics.


## Getting Started

### Initializing Graphene

Add the line below to your applications initialization event (e.g. ASP.Net: Application_Start event, Windows Service: OnStart)

```c#
Graphene.Configurator.Initialize(
                    new Configuration.Settings() { Persister = new Publishing.PersistToMongo("mongodb://localhost/Graphene") }
                );
```

### Creating a Tracker

A tracker is something of business value that needs to be tracked over time. Examples are number of order placed on a commerce site, the performance in MS of a given API etc. during a given time interval. 

To create a tracker implement Graphene.Tracking.ITrackable Interface

```c#
public class CustomerVisitTracker : ITrackable
{
	public string Name { get { return "Customer Visit Tracker"; } }

	public string Description { get { return "Counts the number of customer visits"; } }

	public Resolution MinResolution { get { return Resolution.Hour; } }
}
```

The MinResolution set the minimum time interval that can be tracked. If the interval is set to Hour then one can generate reports of that metrics per hour and above (day/month etc.) but not below that.

The higher the resolution the better Graphene can pre-compute the data and better the queries will perform. 

### Incrementing a Tracker

The line below increments the tracker by 1

```c#
Tracking.Container<CustomerVisitTracker>.IncrementBy(1);
```

### Adding filters

Filters can be added to allow the tracker data to be sliced and diced. For example number of orders placed from a given state or API performance on a given server. 

First step to adding a filter is to define it as a struct.

```c#
public struct CustomerFilter
{
	public string State { get; set; }
	public string StoreID { get; set; }
	public string Gender { get; set; }
	public string Environment_ServerName { get; set; }
}
```

All properties must be string or a nullable type. For Graphene's pre-computation to be optimal the cardinality of the filter values should be low, i.e. the all combination of the filter values should be
on the lower side for best performance.
{'fraction_non_alphanumeric': 0.06784599375650364, 'fraction_numerical': 0.0008324661810613944, 'mean_word_length': 4.1236673773987205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1286225', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1229, 'n_words': 646}