@adobe/rum-distiller

中文文档
1.24.0发布于 2026/10/30Apache-2.0ES Module零依赖构建来源已验证近 30 天下载 2728

RUM Distiller is a JavaScript library for data exploration of Adobe RUM data. It allows you to define the shape of the data first, in the form of "series", "groups", and "facets". You can then filter the data based on the defined facets, and will automati

原始使用文档
文档目录9 节
  1. Estimating “Dark Matter” URLs (Chao1)
  2. Concepts
  3. Bundle
  4. Series
  5. Groups
  6. Facets
  7. Filtering
  8. Performance
  9. Totals

RUM Distiller

RUM Distiller is a JavaScript library for data exploration of Adobe RUM data. It allows you to define the shape of the data first, in the form of "series", "groups", and "facets". You can then filter the data based on the defined facets, and will automatically get data aggregations for the series.

Estimating “Dark Matter” URLs (Chao1)

When sampling hides low‑traffic pages, you can estimate the total number of URLs that received ≥1 visit using a classical unseen‑species estimator (Chao1), plus a 95% CI.

  • Inline API:

    • dc.estimators.plainURL.chao1 returns { sObs, sHat, sUnseen, f1, f2, ci, darkCI } for the current filters/window.
    • Uses raw bundle counts (independent observations), not weighted totals.
  • Direct functions (for raw rows or custom flows):

    • import { chao1, chao1CI, inferSamplesFromCI, estimateDarkMatterFromCI, estimateDarkMatterFromCIWithCI } from './src/estimators/chao1.js'

See algorithm details in src/estimators/README.md.

References

  • Chao, A. (1984). Nonparametric estimation of the number of classes in a population. Scandinavian Journal of Statistics, 11, 265–270. https://doi.org/10.2307/4615964
  • Chao, A. (1987). Estimating the population size for capture–recapture data with unequal catchability. Biometrics, 43(4), 783–791. https://doi.org/10.2307/2531532

Concepts

Bundle

The basic building block of RUM Distiller is the Bundle. A bundle is a collection of events that belong to the same page view. Each bundle has a weight, which is the number of page views that are represented by the bundle.

Due to sampling and subsampling, the weight of a bundle is typically 100 or more.

The next three concepts are the building blocks that describe the shape of the data: Series, Groups, and Facets.

Series

A series is a way to extract a metric from a bundle. Values of a series are always numeric, and allow for simple calculations, like counting, averaging, summing, percentiles, and so on.

At its core, a series is a function that takes a bundle and returns a number. In a graph, you would plot the values of a series on the y-axis.

There are many built-in series included in RUM Distiller, but you can also implement your own custom series.

Once you have a series defined, you can add it to a DataChunks object using the addSeries method.

Groups

A group is a way to group data into a set of buckets. The most common type of grouping is to group by time, but you can also group by other dimensions, if needed.

In a graph, you would plot the values of a group on the y-axis. In practice, many charts such as pie charts, or most bar charts do not require a group.

Programmatically, a group is a function that takes a bundle and returns a string.

Facets

A facet is a way to filter data. For each facet type, there can be multiple facet values and each bundle can satisfy multiple facets values for a given facet type. Most applications define up to a dozen or so facet types.

When filtering, different facets are combined using logical AND, meaning that all facets must be satisfied for a bundle to be included in the result set.

When there are multiple filter values given for one facet type, the facet's combiner decides if it is sufficent if a bundle matches some or every value.

Facets are defined using the addFacet method and a facet value function takes a bundle and returns either a string or an array of strings.

Normally, all facet values are treated as discrete values, but it is possible to turn discrete values into ranges by creating a histogram facet.

Histogram Facets

A histogram facet is a facet that groups data into buckets, based on the values of a base facet.

You can create a histogram facet using the addHistogramFacet method.

A histogram facet is based on an existing facet that returns numeric values. It will then group the data into buckets, each bucket having a lower and upper limit. Each bucket will contain roughly the same number of values, so that the histogram is evenly distributed, and appying a filter on the histogram facet will take good slice of the data.

Filtering

Once the shape of the data is defined, we can query the data using the filter, totals, and facets views. The most fundamental method is to filter.

A filter definition is entirely declarative, so that you do not need to write any imperative code anymore, as this has been handled by the creation of your facets before.

A filter declaration is an object that maps from facet names to either a single value or an array of values. The filter will return all bundles that satisfy each of the facet's value filters, using the combiner to deal with multiple values.

You can apply a filter to a DataChunks object using the filter setter.

// set up the dataChunks
const data = new DataChunks();

// add some data
data.addData(bundles);

// filter the data
data.filter = {
  "device.type": ["desktop", "mobile"],
  "page.path": ["/home", "/about"],
};
// all subsequent calls to data will use this filter

Performance

Facet functions are pure: their result depends only on the bundle. RUM Distiller evaluates each facet function exactly once per bundle (after load/addData/addFacet) and stores the results in a dictionary-encoded, columnar layout (typed arrays). Changing the filter does not re-run any facet function; filtering and counting facet values are integer kernels over these columns.

If you mutate bundles in place after loading them, call resetData() so that facet values are re-computed.

Totals

Remember the metrics that we defined before? The totals view will calculate the metrics for the current filter. The type of these totals is an Aggregate object.

// calculate the totals
const totalPageViews = data.totals.pageViews.sum;

If we have set up a pageViews series, this will be the total number of page views. In addition to getting the sum, we can also get the mean (average), min, max, median, stddev (standard deviation), and percentiles (any arbitrary percentile, e.g. 50th, 90th, 99th percentiles).

版本与发布记录

@adobe/rum-distiller 共发布 49 个版本,首次发布于 2024/10/08;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.24.0latest2026/10/308 天前
1.23.32026/10/0830 天前
1.23.22026/10/0830 天前
1.23.12026/09/111 个月前
1.24.0-prerelease.1prerelease2026/09/022 个月前
1.23.02026/01/289 个月前

关于 @adobe/rum-distiller 的常见问题

@adobe/rum-distiller 是什么?

RUM Distiller is a JavaScript library for data exploration of Adobe RUM data. It allows you to define the shape of the data first, in the form of "series", "groups", and "facets". You can then filter the data based on the defined facets, and will automati

如何安装 @adobe/rum-distiller?

在项目目录运行 npm install @adobe/rum-distiller,或使用 pnpm add / yarn add / bun add。

@adobe/rum-distiller 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adobe__rum-distiller 是否存在。

@adobe/rum-distiller 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adobe/rum-distiller 可以商用吗?

@adobe/rum-distiller 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/rum-distiller 的下载量有多少?

根据 npm 官方下载统计,@adobe/rum-distiller 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,728 次,日均约 91 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/rum-distiller 还在维护吗?

最新版本 1.24.0 发布于 2026/10/30(8 天前);至今共发布 49 个版本,其中过去 12 个月发布了 10 个;首次发布于 2024/10/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。