Skip to content

Commit

Permalink
Rebase with main
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Mar 4, 2024
1 parent 506e3fb commit 4a1b50b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion blocks/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { singleFlight } from "../engine/core/utils.ts";
import { ResolverMiddlewareContext } from "../engine/middleware.ts";
import { meter } from "../observability/otel/metrics.ts";
import { caches as cachesKV } from "../runtime/caches/denoKV.ts";
import { caches as cachesFileSystem } from "../runtime/caches/fileSystem.ts"
import { caches as cachesFileSystem } from "../runtime/caches/fileSystem.ts";
import { HttpContext } from "./handler.ts";
import {
applyProps,
Expand Down
20 changes: 12 additions & 8 deletions runtime/caches/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import {
assertNoOptions,
withCacheNamespace,
} from "./common.ts";
import {existsSync} from "https://deno.land/std/fs/mod.ts";
import { existsSync } from "https://deno.land/std/fs/mod.ts";

const FILE_SYSTEM_CACHE_DIRECTORY = Deno.env.get("FILE_SYSTEM_CACHE_DIRECTORY") ?? undefined;
const FILE_SYSTEM_CACHE_DIRECTORY =
Deno.env.get("FILE_SYSTEM_CACHE_DIRECTORY") ?? undefined;

const downloadDuration = meter.createHistogram("file_system_cache_download_duration", {
description: "file system cache download duration",
unit: "ms",
valueType: ValueType.DOUBLE,
});
const downloadDuration = meter.createHistogram(
"file_system_cache_download_duration",
{
description: "file system cache download duration",
unit: "ms",
valueType: ValueType.DOUBLE,
},
);

const bufferSizeSumObserver = meter.createUpDownCounter("buffer_size_sum", {
description: "Sum of buffer sizes",
Expand Down Expand Up @@ -119,7 +123,7 @@ function createFileSystemCache(): CacheStorage {
const downloadDurationTime = performance.now() - startTime;

span.addEvent("file-system-get-data");

if (data === null) {
span.addEvent("cache-miss");
return undefined;
Expand Down
5 changes: 3 additions & 2 deletions runtime/caches/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import {
init as initZstd,
} from "https://denopkg.com/mcandeia/[email protected]/deno/zstd.ts";

const MAX_UNCOMPRESSED_SIZE =
parseInt(Deno.env.get("CACHE_AWS_MAX_UNCOMPRESSED_SIZE")! ?? "645120");
const MAX_UNCOMPRESSED_SIZE = parseInt(
Deno.env.get("CACHE_AWS_MAX_UNCOMPRESSED_SIZE")! ?? "645120",
);

const zstdPromise = initZstd();

Expand Down

0 comments on commit 4a1b50b

Please sign in to comment.