Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Sep 7, 2023
1 parent a22fee1 commit 0022bed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion service/pool/Logs.mo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module {
case (?n) { canisters.put(origin, n + 1) };
}
};
public func addInstall(origin: Text) {
public func addInstall(origin: Text, referrer: ?Text) {
// TODO: keep track of `referrer`
switch (installs.get(origin)) {
case null { installs.put(origin, 1) };
case (?n) { installs.put(origin, n + 1) };
Expand Down
4 changes: 2 additions & 2 deletions service/pool/Main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
};
await IC.install_code newArgs;
stats := Logs.updateStats(stats, #install);
statsByOrigin.addInstall(install_config.origin);
statsByOrigin.addInstall(install_config.origin, install_config.referrer);
switch (pool.refresh(info, install_config.profiling)) {
case (?newInfo) {
updateTimer(newInfo);
Expand Down Expand Up @@ -335,7 +335,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
switch (sanitizeInputs(caller, canister_id)) {
case (#ok info) {
let args = { arg; wasm_module; mode; canister_id };
let config = { profiling = pool.profiling caller; is_whitelisted = false; origin = "spawned" };
let config = { profiling = pool.profiling caller; is_whitelisted = false; origin = "spawned"; referrer = null };
ignore await installCode(info, args, config); // inherit the profiling of the parent
};
case (#err makeMsg) throw Error.reject(makeMsg "install_code");
Expand Down

0 comments on commit 0022bed

Please sign in to comment.