<commit_before>open Hashtblext
open Listext
open Threadext
open Rrdd_shared
open Rrd
open Ds
open Monitor_types

module D = Debug.Debugger(struct let name = "rrdd_monitor" end)
open D

let create_rras use_min_max =
	(* Create archives of type min, max and average and last *)
	Array.of_list (List.flatten
		(List.map (fun (n,ns) ->
			if ns > 1 && use_min_max then [
				Rrd.rra_create Rrd.CF_Average n ns 1.0;
				Rrd.rra_create Rrd.CF_Min n ns 1.0;
				Rrd.rra_create Rrd.CF_Max n ns 1.0;
			] else [Rrd.rra_create Rrd.CF_Average n ns 0.5]
		) timescales)
	)

let step = 5

(** Create a rrd *)<commit_msg>rrdd: Added comment about potential cleanup of rrdd code.<commit_after>open Hashtblext
open Listext
open Threadext
open Rrdd_shared
open Rrd
open Ds
open Monitor_types

module D = Debug.Debugger(struct let name = "rrdd_monitor" end)
open D

(* TODO: It is now possible to remove quite a bit of code tracking for changes
 * (e.g. 'changed' and 'dirty_XYZ'), since this is all being done in
 * xapi/monitor_dbcalls. *)

let create_rras use_min_max =
	(* Create archives of type min, max and average and last *)
	Array.of_list (List.flatten
		(List.map (fun (n,ns) ->
			if ns > 1 && use_min_max then [
				Rrd.rra_create Rrd.CF_Average n ns 1.0;
				Rrd.rra_create Rrd.CF_Min n ns 1.0;
				Rrd.rra_create Rrd.CF_Max n ns 1.0;
			] else [Rrd.rra_create Rrd.CF_Average n ns 0.5]
		) timescales)
	)

let step = 5

(** Create a rrd *)
{'fraction_non_alphanumeric': 0.09477351916376307, 'fraction_numerical': 0.013937282229965157, 'mean_word_length': 3.5443037974683542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4196942', 'n_tokens_mistral': 610, 'n_tokens_neox': 561, 'n_words': 183}