Skip to content

Merge master to feature/guest-vm-service-aware #6406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
938bdb4
CA-408550: XSI-1834: Host netbios name should be added to local
liulinC Mar 21, 2025
f352a56
CP-54020: Split the mux policy from storage_mux
Vincent-lau Mar 20, 2025
4d9bc8c
CP-54020: Introduce `smapi_version` in query result
Vincent-lau Mar 20, 2025
a390098
CP-54020: Factor out the MIRROR module
Vincent-lau Mar 20, 2025
6ac37d7
CA-408500: Remove ListFile with Xapi_stdext_unix.Unixext
liulinC Mar 25, 2025
4a1b657
CP-54020: Factor out sxm state tracking logic
Vincent-lau Mar 20, 2025
1044120
CP-54020: Factor out module creation logic
Vincent-lau Mar 20, 2025
7f349f3
Delete unused `query_result_of_sr` function
Vincent-lau Mar 20, 2025
112ef69
style: Some coding style improvements
Vincent-lau Mar 21, 2025
71ce008
CP-53472: Create parent for add_module spans
snwoods Mar 28, 2025
5c387c4
libs: resources tests
psafont Mar 28, 2025
f2f72dc
xapi-stdext-threads, test: use stable testing interface
psafont Mar 28, 2025
4ee32f2
CA-408841 rrd: don't update rrds when ds_update is called with an emp…
Mar 31, 2025
7ca0ce2
Remove xapi-stdext-date
psafont Mar 31, 2025
d3a7430
Fix a couple of issues when compiling with future versions of depende…
psafont Apr 1, 2025
0441299
CA-408550: XSI-1834: Host netbios name should be added to local hosts…
liulinC Apr 1, 2025
29015dd
CP-53472: Create parent for add_module spans (#6390)
edwintorok Apr 2, 2025
8442197
opam: move all opam files to the opam subdir
psafont Apr 2, 2025
08fc9cf
github: update docs workflow to use latest setup-ocaml
psafont Apr 2, 2025
7991e12
CP-54020: Refactor sxm and storage_mux code (#6378)
Vincent-lau Apr 2, 2025
649e2b1
opam: move all opam files to the opam subdir (#6402)
psafont Apr 2, 2025
b5894f5
CA-408841 rrd: don't call ds_update with an empty datasource array (#…
last-genius Apr 3, 2025
586921f
maintenance: replace most 'maybe' functions
psafont Mar 21, 2025
3bf9f90
numa: add test binary that prints changes in free memory and domain l…
psafont Mar 4, 2025
6a915a3
CP-53658: adapt claim_pages to new version with numa node parameter
psafont Mar 10, 2025
33abbd2
xenctrl: Don't use numa_node in domain_claim_pages calls
psafont Mar 12, 2025
687ad1d
xenopsd: log_reraise doesn't ignore the result
psafont Mar 17, 2025
6f6b638
CP-54065, xenopsd: use domain_claim_pages on a single node, if possible
psafont Mar 12, 2025
9e6fb15
xenopsd/xc: Do not try to allocate pages to a particular NUMA node
psafont Mar 26, 2025
e21647c
CP-53658: Claim memory on a single NUMA node (#6369)
psafont Apr 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,23 @@ jobs:
- name: Update Ubuntu repositories
run: sudo apt-get update

# We set DUNE_CACHE_STORAGE_MODE, it is required for dune cache to work inside opam for now,
# otherwise it gets EXDEV and considers it a cache miss
- name: Use ocaml
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repositories: |
xs-opam: ${{ steps.dotenv.outputs.repository }}
dune-cache: true
opam-pin: false
cache-prefix: v3-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}
env:
DUNE_CACHE_STORAGE_MODE: copy

- name: Install dependencies
run: opam pin list --short | xargs opam install --deps-only -v
shell: bash
run: opam install . --deps-only -v

- name: Generate xapi-storage docs
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ DUNE_IU_PACKAGES1+=message-switch message-switch-cli message-switch-core message
DUNE_IU_PACKAGES1+=message-switch-unix xapi-idl xapi-forkexecd xapi-storage xapi-storage-script xapi-storage-cli
DUNE_IU_PACKAGES1+=xapi-nbd varstored-guard xapi-log xapi-open-uri xapi-tracing xapi-tracing-export xapi-expiry-alerts cohttp-posix
DUNE_IU_PACKAGES1+=xapi-rrd xapi-inventory clock xapi-sdk
DUNE_IU_PACKAGES1+=xapi-stdext-date xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools
DUNE_IU_PACKAGES1+=xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools


install-dune1:
Expand Down
11 changes: 1 addition & 10 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(formatting (enabled_for ocaml))
(using menhir 2.0)
(using directory-targets 0.1)
(opam_file_location inside_opam_directory)

(cram enable)
(implicit_transitive_deps false)
Expand Down Expand Up @@ -669,16 +670,6 @@ This package provides an Lwt compatible interface to the library.")
(name xapi-inventory)
)

(package
(name xapi-stdext-date)
(synopsis "Xapi's standard library extension, Dates")
(authors "Jonathan Ludlam")
(depends
(clock (= :version))
ptime
)
)

(package
(name xapi-stdext-encodings)
(synopsis "Xapi's standard library extension, Encodings")
Expand Down
1 change: 1 addition & 0 deletions ocaml/libs/resources/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(action (run %{test} -e))
(libraries
safe-resources
logs
logs.fmt
alcotest
)
Expand Down
203 changes: 103 additions & 100 deletions ocaml/libs/xapi-rrd/lib/rrd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -379,121 +379,124 @@ let process_ds_value ds value interval new_rrd =
rate

let ds_update rrd timestamp valuesandtransforms new_rrd =
(* Interval is the time between this and the last update

Currently ds_update is called with datasources that belong to a single
plugin, correspondingly they all have the same timestamp.
Further refactoring is needed if timestamps per measurement are to be
introduced. *)
let first_ds_index, _ = valuesandtransforms.(0) in
let last_updated = rrd.rrd_dss.(first_ds_index).ds_last_updated in
let interval = timestamp -. last_updated in
(* Work around the clock going backwards *)
let interval = if interval < 0. then 5. else interval in

(* start time (st) and age of the last processed pdp and the currently occupied one *)
let proc_pdp_st, _proc_pdp_age = get_times last_updated rrd.timestep in
let occu_pdp_st, occu_pdp_age = get_times timestamp rrd.timestep in

(* The number of pdps that should result from this update *)
let elapsed_pdp_st =
Int64.to_int ((occu_pdp_st --- proc_pdp_st) /// rrd.timestep)
in

(* if we're due one or more PDPs, pre_int is the amount of the
current update interval that will be used in calculating them, and
post_int is the amount left over
this step. If a PDP isn't post is what's left over *)
let pre_int, post_int =
if elapsed_pdp_st > 0 then
let pre = interval -. occu_pdp_age in
(pre, occu_pdp_age)
else
(interval, 0.0)
in

(* We're now done with the last_updated value, so update it *)
rrd.last_updated <- timestamp ;
(* CA-408841 - don't update the rrd at all if list of datasources is empty *)
if valuesandtransforms <> [||] then (
(* Interval is the time between this and the last update

Currently ds_update is called with datasources that belong to a single
plugin, correspondingly they all have the same timestamp.
Further refactoring is needed if timestamps per measurement are to be
introduced. *)
let first_ds_index, _ = valuesandtransforms.(0) in
let last_updated = rrd.rrd_dss.(first_ds_index).ds_last_updated in
let interval = timestamp -. last_updated in
(* Work around the clock going backwards *)
let interval = if interval < 0. then 5. else interval in

(* start time (st) and age of the last processed pdp and the currently occupied one *)
let proc_pdp_st, _proc_pdp_age = get_times last_updated rrd.timestep in
let occu_pdp_st, occu_pdp_age = get_times timestamp rrd.timestep in

(* The number of pdps that should result from this update *)
let elapsed_pdp_st =
Int64.to_int ((occu_pdp_st --- proc_pdp_st) /// rrd.timestep)
in

(* Calculate the values we're going to store based on the input data and the type of the DS *)
let v2s =
Array.map
(fun (i, {value; _}) ->
let v = process_ds_value rrd.rrd_dss.(i) value interval new_rrd in
rrd.rrd_dss.(i).ds_last_updated <- timestamp ;
(i, v)
)
valuesandtransforms
in
(* Update the PDP accumulators up until the most recent PDP *)
Array.iter
(fun (i, value) ->
let ds = rrd.rrd_dss.(i) in
if Utils.isnan value then
ds.ds_unknown_sec <- pre_int
(* if we're due one or more PDPs, pre_int is the amount of the
current update interval that will be used in calculating them, and
post_int is the amount left over
this step. If a PDP isn't post is what's left over *)
let pre_int, post_int =
if elapsed_pdp_st > 0 then
let pre = interval -. occu_pdp_age in
(pre, occu_pdp_age)
else
(* CA-404597 - Gauge and Absolute values should be passed as-is,
without being involved in time-based calculations at all.
This applies to calculations below as well *)
match ds.ds_ty with
| Gauge | Absolute ->
ds.ds_value <- value
| Derive ->
ds.ds_value <- ds.ds_value +. (pre_int *. value /. interval)
)
v2s ;
(interval, 0.0)
in

(* We're now done with the last_updated value, so update it *)
rrd.last_updated <- timestamp ;

(* If we've passed a PDP point, we need to update the RRAs *)
if elapsed_pdp_st > 0 then (
(* Calculate the PDPs for each DS *)
let pdps =
(* Calculate the values we're going to store based on the input data and the type of the DS *)
let v2s =
Array.map
(fun (i, {transform; _}) ->
let ds = rrd.rrd_dss.(i) in
if interval > ds.ds_mrhb then
(i, nan)
else
let raw =
let proc_pdp_st = get_float_time last_updated rrd.timestep in
let occu_pdp_st = get_float_time timestamp rrd.timestep in

match ds.ds_ty with
| Gauge | Absolute ->
ds.ds_value
| Derive ->
ds.ds_value
/. (occu_pdp_st -. proc_pdp_st -. ds.ds_unknown_sec)
in
(* Apply the transform after the raw value has been calculated *)
let raw = apply_transform_function transform raw in
(* Make sure the values are not out of bounds after all the processing *)
if raw < ds.ds_min || raw > ds.ds_max then
(i, nan)
else
(i, raw)
(fun (i, {value; _}) ->
let v = process_ds_value rrd.rrd_dss.(i) value interval new_rrd in
rrd.rrd_dss.(i).ds_last_updated <- timestamp ;
(i, v)
)
valuesandtransforms
in

rra_update rrd proc_pdp_st elapsed_pdp_st pdps ;

(* Reset the PDP accumulators *)
(* Update the PDP accumulators up until the most recent PDP *)
Array.iter
(fun (i, value) ->
let ds = rrd.rrd_dss.(i) in
if Utils.isnan value then (
ds.ds_value <- 0.0 ;
ds.ds_unknown_sec <- post_int
) else (
ds.ds_unknown_sec <- 0.0 ;
if Utils.isnan value then
ds.ds_unknown_sec <- pre_int
else
(* CA-404597 - Gauge and Absolute values should be passed as-is,
without being involved in time-based calculations at all.
This applies to calculations below as well *)
match ds.ds_ty with
| Gauge | Absolute ->
ds.ds_value <- value
| Derive ->
ds.ds_value <- post_int *. value /. interval
)
ds.ds_value <- ds.ds_value +. (pre_int *. value /. interval)
)
v2s
v2s ;

(* If we've passed a PDP point, we need to update the RRAs *)
if elapsed_pdp_st > 0 then (
(* Calculate the PDPs for each DS *)
let pdps =
Array.map
(fun (i, {transform; _}) ->
let ds = rrd.rrd_dss.(i) in
if interval > ds.ds_mrhb then
(i, nan)
else
let raw =
let proc_pdp_st = get_float_time last_updated rrd.timestep in
let occu_pdp_st = get_float_time timestamp rrd.timestep in

match ds.ds_ty with
| Gauge | Absolute ->
ds.ds_value
| Derive ->
ds.ds_value
/. (occu_pdp_st -. proc_pdp_st -. ds.ds_unknown_sec)
in
(* Apply the transform after the raw value has been calculated *)
let raw = apply_transform_function transform raw in
(* Make sure the values are not out of bounds after all the processing *)
if raw < ds.ds_min || raw > ds.ds_max then
(i, nan)
else
(i, raw)
)
valuesandtransforms
in

rra_update rrd proc_pdp_st elapsed_pdp_st pdps ;

(* Reset the PDP accumulators *)
Array.iter
(fun (i, value) ->
let ds = rrd.rrd_dss.(i) in
if Utils.isnan value then (
ds.ds_value <- 0.0 ;
ds.ds_unknown_sec <- post_int
) else (
ds.ds_unknown_sec <- 0.0 ;
match ds.ds_ty with
| Gauge | Absolute ->
ds.ds_value <- value
| Derive ->
ds.ds_value <- post_int *. value /. interval
)
)
v2s
)
)

(** Update the rrd with named values rather than just an ordered array
Expand Down
35 changes: 0 additions & 35 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-date/date.ml

This file was deleted.

Loading
Loading