Skip to content

handle metrics received#251

Open
PizieDust wants to merge 4 commits into
scale_upfrom
handle_metrics
Open

handle metrics received#251
PizieDust wants to merge 4 commits into
scale_upfrom
handle_metrics

Conversation

@PizieDust

Copy link
Copy Markdown
Collaborator

This PR connects the metrics reeived from albatross with the autoscaling logic to determine if we should spawn new vms or destroy clones.

Comment thread unikernel.ml
let unikernel_name =
match Vmm_core.Name.name name with
| Some label -> Vmm_core.Name.Label.to_string label
| None -> Vmm_core.Name.to_string name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? When is this supposed to happen, and why is using "Vmm_core.Name.to_string name" the right thing here?

Comment thread unikernel.ml
Logs.debug ~src:stats_src (fun m ->
m "[Stats] Received stats for %s as %a" unikernel_name
Vmm_core.Stats.pp st);
Lwt.async (fun () ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an Lwt.async?

Comment thread unikernel.ml
m "[Stats] Received stats for %s as %a" unikernel_name
Vmm_core.Stats.pp st);
Lwt.async (fun () ->
handle_stats stack instance st ~unikernel_name user >>= function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does handle_stats need a stack argument?

Comment thread unikernel.ml
@@ -3160,11 +3263,12 @@

let start_background_scaler_scheduler stack store albatross_instances_ref =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand the complexity of this function.

How often and when are "stats_stream" spawned? From my understanding, mollymawk would need one stream for each albatross instance, but it looks like for each user and each albatross there's eventually a stream?

Comment thread unikernel.ml
Comment on lines 3301 to 3302
let current_instances = !albatross_instances_ref in
let valid_keys = Hashtbl.create 5 in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand why there's need for yet another Hash table, "valid_keys".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants