@dapplion/benchmark
Version:
Ensures that new code does not introduce performance regressions with CI. Tracks:
23 lines (22 loc) • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHistoryLocation = void 0;
exports.getHistoryProvider = getHistoryProvider;
const location_js_1 = require("./location.js");
Object.defineProperty(exports, "resolveHistoryLocation", { enumerable: true, get: function () { return location_js_1.resolveHistoryLocation; } });
const local_js_1 = require("./local.js");
const gaCache_js_1 = require("./gaCache.js");
const options_js_1 = require("../options.js");
const s3_js_1 = require("./s3.js");
function getHistoryProvider(opts) {
if (opts.historyGaCache) {
const cacheKey = typeof opts.historyGaCache === "string" ? opts.historyGaCache : options_js_1.optionsDefault.historyCacheKey;
return (0, gaCache_js_1.getGaCacheHistoryProvider)(cacheKey);
}
if (opts.historyS3) {
return s3_js_1.S3HistoryProvider.fromEnv();
}
// if opts.historyLocal or else
const dirpath = typeof opts.historyLocal === "string" ? opts.historyLocal : options_js_1.optionsDefault.historyLocalPath;
return new local_js_1.LocalHistoryProvider(dirpath);
}