<commit_before>﻿namespace FotM.Argus

open System
open System.Collections.Generic
open System.Diagnostics
open System.Linq
open System.Net
open System.Threading
open Microsoft.WindowsAzure
open Microsoft.WindowsAzure.Diagnostics
open Microsoft.WindowsAzure.ServiceRuntime

type WorkerRole() =
    inherit RoleEntryPoint() 

    // This is a sample worker implementation. Replace with your logic.

    let log message (kind : string) = Trace.TraceInformation(message, kind)

    override wr.Run() =

        log "FotM.Argus entry point called" "Information"
        while(true) do 
            Thread.Sleep(10000)
            log "Working" "Information"

    override wr.OnStart() = 

        // Set the maximum number of concurrent connections 
        ServicePointManager.DefaultConnectionLimit <- 12
       
        // For information on handling configuration changes
        // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

        base.OnStart()<commit_msg>Tinkering with worker role before deployment.<commit_after>﻿namespace FotM.Argus

open System
open System.Collections.Generic
open System.Diagnostics
open System.Linq
open System.Net
open System.Threading
open Microsoft.WindowsAzure
open Microsoft.WindowsAzure.Diagnostics
open Microsoft.WindowsAzure.ServiceRuntime

type WorkerRole() =
    inherit RoleEntryPoint() 

    // This is a sample worker implementation. Replace with your logic.

    let log (kind : string) message  = 
        let msg = sprintf "[%A] %s" DateTime.UtcNow message
        Trace.TraceInformation(msg, kind)

    let logInfo = log "Information"

    let rec run i = 
        let msg = (sprintf "Working. Current iteration: %i" i)
        logInfo msg

        if i = 5 then
            failwith "that's enough for now"
        else
            Thread.Sleep(5000)
            run (i+1)

    override wr.Run() =

        logInfo "FotM.Argus entry point called"
        run 0

    override wr.OnStart() = 

        // Set the maximum number of concurrent connections 
        ServicePointManager.DefaultConnectionLimit <- 12
       
        // For information on handling configuration changes
        // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

        base.OnStart()

    override wr.OnStop() =
        logInfo "Graceful shutdown."
{'fraction_non_alphanumeric': 0.07805088400172489, 'fraction_numerical': 0.01207416990081932, 'mean_word_length': 2.665086887835703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5796859', 'n_tokens_mistral': 656, 'n_tokens_neox': 599, 'n_words': 200}