<commit_before>type config = {
  comp_id        : string;
  host_id        : string option;
  on_behalf_id   : string option;
  target_id      : string;
  timer          : float;
  reset_seq      : bool;  
  pub_callback   : (Model_messages.model_msg -> unit Lwt.t) option;
}

type t = {
  heartbeat : unit Lwt.t;
  fix       : unit Lwt.t;
  mailbox   : Fix_global_state.incoming_event Lwt_mvar.t;
  initmsg   : Fix_engine_state.fix_engine_int_inc_msg;
}

let get_heartbeat_thread t = t.heartbeat
let get_fix_thread       t = t.fix 
let get_input_mailbox    t = t.mailbox 
let create_session_msg   t = t.initmsg


let get_current_utctimstamp () =    
  let open Datetime in
  let dtime = Unix.gettimeofday () in 
  let tm = Unix.gmtime dtime in
  let msec = int_of_float (1000000. *. (dtime -. floor dtime)) in
  {  utc_timestamp_year   = tm.Unix.tm_year + 1900
  ;  utc_timestamp_month  = tm.Unix.tm_mon + 1
  ;  utc_timestamp_day    = tm.Unix.tm_mday
  ;  utc_timestamp_hour   = tm.Unix.tm_hour
  ;  utc_timestamp_minute = tm.Unix.tm_min
  ;  utc_timestamp_second = tm.Unix.tm_sec
  ;  utc_timestamp_millisec = Some (msec)
}

let last_received_utctimestamp = ref ( get_current_utctimstamp() )
let get_last_received_utctimestamp () = ! last_received_utctimestamp 

let last_received_sendingtime = ref ( get_current_utctimstamp() )
let get_last_received_sendingtime () = ! last_received_sendingtime

let read_int file =
  try
    let chn = open_in file in
    let num = input_line chn in
    let () = close_in chn in
    int_of_string num
  with
    _exn -> 0
;;

let read_seqns dir =
  if not(Sys.file_exists dir) then 
    let () = Unix.(mkdir dir 0o775) in (0,0)  
  else
    let seqin  = read_int Filename.(concat dir "seqin" ) in<commit_msg>updating fix connection to use default timestampe precision<commit_after>type config = {
  comp_id        : string;
  host_id        : string option;
  on_behalf_id   : string option;
  target_id      : string;
  timer          : float;
  reset_seq      : bool;  
  pub_callback   : (Model_messages.model_msg -> unit Lwt.t) option;
}

type t = {
  heartbeat : unit Lwt.t;
  fix       : unit Lwt.t;
  mailbox   : Fix_global_state.incoming_event Lwt_mvar.t;
  initmsg   : Fix_engine_state.fix_engine_int_inc_msg;
}

let get_heartbeat_thread t = t.heartbeat
let get_fix_thread       t = t.fix 
let get_input_mailbox    t = t.mailbox 
let create_session_msg   t = t.initmsg


let get_current_utctimstamp () =    
  let open Datetime in
  let dtime = Unix.gettimeofday () in 
  let tm = Unix.gmtime dtime in
  let msec = int_of_float (1000000. *. (dtime -. floor dtime)) in
  TimeDefaults.make_utctimestamp (tm.Unix.tm_year + 1900)
    (tm.Unix.tm_mon + 1) tm.Unix.tm_mday tm.Unix.tm_hour
    tm.Unix.tm_min tm.Unix.tm_sec  (Some msec)
;;


let last_received_utctimestamp = ref ( get_current_utctimstamp() )
let get_last_received_utctimestamp () = ! last_received_utctimestamp 

let last_received_sendingtime = ref ( get_current_utctimstamp() )
let get_last_received_sendingtime () = ! last_received_sendingtime

let read_int file =
  try
    let chn = open_in file in
    let num = input_line chn in
    let () = close_in chn in
    int_of_string num
  with
    _exn -> 0
;;

let read_seqns dir =
  if not(Sys.file_exists dir) then 
    let () = Unix.(mkdir dir 0o775) in (0,0)  
  else
    let seqin  = read_int Filename.(concat dir "seqin" ) in
{'fraction_non_alphanumeric': 0.08441558441558442, 'fraction_numerical': 0.011216056670602124, 'mean_word_length': 3.1029055690072638, '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': '906487', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1299, 'n_words': 296}