xb123

MoonHAR: a MoonBit library and CLI toolkit for parsing, validating, and analyzing HTTP Archive files.

har
http
performance
analysis
moonbit
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
15 hours ago
Downloads
4

Dependencies

#MoonHAR HTTP Archive 解析与性能分析库

MoonHAR 是一个使用 MoonBit 原生实现的 HTTP Archive(HAR)解析与性能分析库。它将 HAR 风格的 JSON 文本映射为类型化数据,提供校验、统计、预算、瀑布流、脱敏、对比和报表能力,适用于 Web 性能排查、接口审计和 CI 性能回归检查。

#已实现功能

  • 解析 JSON 基础类型、对象、数组、转义字符和 Unicode 代理对。
  • 映射 HAR 1.2 常用结构,包括 page、entry、request、response、timings、headers、cookies、queryString 和 postData。
  • 校验必填字段、状态码、URL、请求方法、大小和 timing 合法性。
  • 汇总请求数、失败数、重定向、缓存、域名、状态段、资源类型、传输大小和慢请求。
  • 提供性能预算、百分位指标、瀑布流、时间线、URL 模式、质量评分和前后档案对比。
  • 导出文本、CSV 和紧凑 JSON,并提供 URL、请求头和 Cookie 脱敏辅助函数。

#本地验证

需要可用的 MoonBit 工具链。在仓库根目录运行:

moon check --deny-warn moon test --deny-warn moon fmt --check moon run --target js cmd/main -- summary examples/sample.har.json

CLI 会从命令行给出的路径读取真实 HAR 文件,运行环境需要 Node.js。可读样例位于 examples/sample.har.json

#命令行工具

# 性能摘要;添加 --json 可输出 JSON moon run --target js cmd/main -- summary examples/sample.har.json # 结构和语义校验;发现错误时退出码为 2 moon run --target js cmd/main -- validate examples/sample.har.json # 完整报告;--json 适合保存或交给其他工具处理 moon run --target js cmd/main -- report examples/sample.har.json --json # 请求瀑布表;添加 --json 可输出 JSON moon run --target js cmd/main -- waterfall examples/sample.har.json # 性能预算;失败时退出码为 3,可直接用于 CI 门禁 moon run --target js cmd/main -- budget examples/sample.har.json --strict # 请求明细 CSV moon run --target js cmd/main -- csv examples/sample.har.json

查看完整帮助:

moon run --target js cmd/main -- --help

#作为依赖使用

项目发布到 mooncakes.io 后,可在其他 MoonBit 模块中添加依赖:

moon add k5111114s/xb123

包导入配置:

///|
import {
"k5111114s/xb123" @har,
}

最小分析流程:

///|
fn analyze_har_text(text : String) -> String {
match @har.parse_har(text) {
Ok(archive) => {
let diagnostics = @har.validate_archive(archive)
if diagnostics.any(item => item.severity == @har.Error) {
@har.render_diagnostics(diagnostics)
} else {
@har.render_summary(@har.analyze_archive(archive))
}
}
Err(error) => error.path + ": " + error.message
}
}

parse_har 接收已经读入内存的字符串,因此库本身不绑定特定文件系统或运行后端。MoonBit 字段 HarRequest.http_method 对应 HAR JSON 中的 method 字段。

#主要 API

能力API
解析与校验parse_jsonparse_harvalidate_archive
汇总与指标analyze_archiveentry_time_statsp95_time
查询与筛选filter_entriesselect_by_status_rangeselect_wait_bound
预算与质量check_budgetscore_archivegenerate_insights
报告与导出render_summaryexport_entries_csvexport_full_report_json
隐私与对比redact_urlredact_paircompare_archives

完整公开接口由 moon info 生成在 pkg.generated.mbti

#功能边界

MoonHAR 当前聚焦离线解析与分析,不负责抓包、网络请求或浏览器自动化。类型化模型只保留已声明的 HAR 核心字段;如需访问扩展字段,可先使用 parse_json 获得 JVal。CLI 支持从本地文件读取 HAR,并提供摘要、校验、报告、瀑布流、预算和 CSV 六个命令。时间字段按整数毫秒处理,不进行日期时区计算。

HAR 文件可能包含令牌、Cookie、查询参数和请求正文。向日志或 CI 上传报告前,请先阅读 SECURITY.md 并按场景使用脱敏函数。

#工程资料

本项目采用 Apache License 2.0

BudgetResult

pub(all) struct BudgetResult {
passed : Bool
diagnostics : Array[Diagnostic]
} derive(Eq,
Debug
)

Diagnostic

pub(all) struct Diagnostic {
severity : Severity
code : String
path : String
message : String
} derive(Eq,
Debug
)

Validation diagnostic.

DomainStat

pub(all) struct DomainStat {
domain : String
count : Int
bytes : Int
failures : Int
} derive(Eq,
Debug
)

Domain aggregate.

EntryFilter

pub(all) struct EntryFilter {
domain : String?
http_method : String?
status_min : Int?
status_max : Int?
resource : String?
slow_ms : Int?
url_contains : String?
failed_only : Bool
} derive(Eq,
Debug
)

Request filter used by query helpers.

EntryFilter::failed

fn EntryFilter::failed() -> EntryFilter

EntryFilter::for_domain

fn EntryFilter::for_domain(domain : String) -> EntryFilter

EntryFilter::for_method

fn EntryFilter::for_method(http_method : String) -> EntryFilter

EntryFilter::for_resource

fn EntryFilter::for_resource(kind : String) -> EntryFilter

EntryFilter::new

EntryFilter::slow

fn EntryFilter::slow(ms : Int) -> EntryFilter

HarArchive

pub(all) struct HarArchive {
log : HarLog
} derive(Eq,
Debug
)

Parsed HAR document.

HarBudget

pub(all) struct HarBudget {
max_entries : Int
max_total_bytes : Int
max_total_time : Int
max_average_time : Int
max_failed : Int
max_redirects : Int
max_slowest_time : Int
} derive(Eq,
Debug
)

Performance budget configuration.

HarBudget::default

fn HarBudget::default() -> HarBudget

HarBudget::strict

fn HarBudget::strict() -> HarBudget

HarContent

pub(all) struct HarContent {
size : Int
mime_type : String
text : String
encoding : String
} derive(Eq,
Debug
)

HAR response body content.

HarEntry

pub(all) struct HarEntry {
started_date_time : String
time : Int
request : HarRequest
response : HarResponse
timings : HarTimings
server_ip_address : String
connection : String
pageref : String
} derive(Eq,
Debug
)

HAR entry model.

HarError

pub(all) struct HarError {
path : String
message : String
} derive(Eq,
Debug
)

Parse or mapping problem with a stable path.

HarLog

pub(all) struct HarLog {
version : String
creator_name : String
creator_version : String
pages : Array[HarPage]
entries : Array[HarEntry]
} derive(Eq,
Debug
)

Top-level HAR log.

HarPage

pub(all) struct HarPage {
id : String
title : String
started_date_time : String
page_timings : HarPageTimings
} derive(Eq,
Debug
)

HAR page model.

HarPageTimings

pub(all) struct HarPageTimings {
on_content_load : Int
on_load : Int
} derive(Eq,
Debug
)

Page timings stored at HAR page level.

HarPair

pub(all) struct HarPair {
name : String
value : String
} derive(Eq,
Debug
)

Name/value pair used by headers, cookies, and query strings.

HarPostData

pub(all) struct HarPostData {
mime_type : String
text : String
params : Array[HarPair]
} derive(Eq,
Debug
)

HAR request payload model.

HarRequest

pub(all) struct HarRequest {
http_method : String
url : String
http_version : String
headers : Array[HarPair]
query_string : Array[HarPair]
cookies : Array[HarPair]
headers_size : Int
body_size : Int
post_data : HarPostData?
} derive(Eq,
Debug
)

HAR request model.

HarResponse

pub(all) struct HarResponse {
status : Int
status_text : String
http_version : String
headers : Array[HarPair]
cookies : Array[HarPair]
content : HarContent
redirect_url : String
headers_size : Int
body_size : Int
} derive(Eq,
Debug
)

HAR response model.

HarSummary

pub(all) struct HarSummary {
entry_count : Int
page_count : Int
failed_count : Int
redirected_count : Int
cached_count : Int
total_bytes : Int
total_time : Int
longest_time : Int
average_time : Int
domains : Array[DomainStat]
statuses : Array[StatusStat]
resources : Array[ResourceStat]
slow_entries : Array[SlowEntry]
} derive(Eq,
Debug
)

Main summary returned by the analyzer.

HarTimings

pub(all) struct HarTimings {
blocked : Int
dns : Int
connect : Int
ssl : Int
send : Int
wait : Int
receive : Int
} derive(Eq,
Debug
)

Timing fields are milliseconds. A value of -1 means the phase was omitted.

Insight

pub(all) struct Insight {
title : String
severity : Severity
detail : String
} derive(Eq,
Debug
)

JVal

pub(all) enum JVal {
JNull
JBool(Bool)
JNum(String)
JStr(String)
JArr(Array[JVal])
JObj(Map[String, JVal])
} derive(Eq,
Debug
)

JSON value used by MoonHAR.

NumericStats

pub(all) struct NumericStats {
count : Int
min : Int
max : Int
total : Int
average : Int
} derive(Eq,
Debug
)

QualityScore

pub(all) struct QualityScore {
score : Int
grade : String
notes : Array[String]
} derive(Eq,
Debug
)

ReadinessItem

pub(all) struct ReadinessItem {
name : String
passed : Bool
detail : String
} derive(Eq,
Debug
)

RedactionPolicy

pub(all) struct RedactionPolicy {
redact_query : Bool
redact_tokens : Bool
redact_cookies : Bool
redact_domains : Bool
replacement : String
} derive(Eq,
Debug
)

Redaction options for reports.

RedactionPolicy::default

ResourceStat

pub(all) struct ResourceStat {
kind : String
count : Int
bytes : Int
} derive(Eq,
Debug
)

Resource-type aggregate.

Severity

pub(all) enum Severity {
Info
Warning
Error
} derive(Eq,
Debug
)

Diagnostic severity for validation findings.

SlowEntry

pub(all) struct SlowEntry {
url : String
http_method : String
status : Int
time : Int
wait : Int
receive : Int
} derive(Eq,
Debug
)

Slow request projection.

StatusStat

pub(all) struct StatusStat {
group : String
count : Int
} derive(Eq,
Debug
)

Status-code aggregate.

SummaryDiff

pub(all) struct SummaryDiff {
entry_delta : Int
failed_delta : Int
bytes_delta : Int
total_time_delta : Int
average_time_delta : Int
longest_time_delta : Int
} derive(Eq,
Debug
)

Difference between two HAR summaries.

TimelineEvent

pub(all) struct TimelineEvent {
at : Int
label : String
url : String
entry_index : Int
} derive(Eq,
Debug
)

UrlPattern

pub(all) struct UrlPattern {
pattern : String
count : Int
total_time : Int
total_bytes : Int
} derive(Eq,
Debug
)

WaterfallRow

pub(all) struct WaterfallRow {
index : Int
url : String
domain : String
http_method : String
status : Int
kind : String
start_offset : Int
duration : Int
blocked : Int
dns : Int
connect : Int
ssl : Int
send : Int
wait : Int
receive : Int
bytes : Int
} derive(Eq,
Debug
)

Normalized waterfall row for renderers.

about_text

fn about_text() -> String

analyze_archive

fn analyze_archive(archive : HarArchive) -> HarSummary

api_budget

fn api_budget() -> HarBudget

best_profile_for_archive

fn best_profile_for_archive(archive : HarArchive) -> String

budget_by_profile

fn budget_by_profile(name : String) -> HarBudget

budget_score

fn budget_score(archive : HarArchive, budget : HarBudget) -> Int

build_timeline

fn build_timeline(archive : HarArchive) -> Array[TimelineEvent]

build_waterfall

fn build_waterfall(archive : HarArchive) -> Array[WaterfallRow]

cache_policy

fn cache_policy(entry : HarEntry) -> String

check_budget

fn check_budget(archive : HarArchive, budget : HarBudget) -> BudgetResult

ci_budget

fn ci_budget() -> HarBudget

collect_url_patterns

fn collect_url_patterns(archive : HarArchive) -> Array[UrlPattern]

compare_archives

fn compare_archives(before : HarArchive, after : HarArchive) -> SummaryDiff

compare_summaries

fn compare_summaries(before : HarSummary, after : HarSummary) -> SummaryDiff

connect_time_stats

fn connect_time_stats(entries : Array[HarEntry]) -> NumericStats

content_type

fn content_type(entry : HarEntry) -> String

count_failed

fn count_failed(entries : Array[HarEntry]) -> Int

count_method

fn count_method(entries : Array[HarEntry], http_method : String) -> Int

count_redirects

fn count_redirects(entries : Array[HarEntry]) -> Int

count_resource

fn count_resource(entries : Array[HarEntry], kind : String) -> Int

csv_cell

fn csv_cell(value : String) -> String

describe_profile

fn describe_profile(name : String) -> String

desktop_budget

fn desktop_budget() -> HarBudget

diff_is_regression

fn diff_is_regression(diff : SummaryDiff) -> Bool

dns_time_stats

fn dns_time_stats(entries : Array[HarEntry]) -> NumericStats

documentation_budget

fn documentation_budget() -> HarBudget

domain_count

fn domain_count(summary : HarSummary, domain : String) -> Int

domain_delta

fn domain_delta(before : HarSummary, after : HarSummary, domain : String) -> Int

entries_for_domain

fn entries_for_domain(entries : Array[HarEntry], domain : String) -> Array[HarEntry]

entries_for_status_group

fn entries_for_status_group(entries : Array[HarEntry], group : String) -> Array[HarEntry]

entries_over_time

fn entries_over_time(entries : Array[HarEntry], ms : Int) -> Array[HarEntry]

entries_with_header

fn entries_with_header(entries : Array[HarEntry], name : String) -> Array[HarEntry]

entry_bytes

fn entry_bytes(entry : HarEntry) -> Int

entry_matches

fn entry_matches(entry : HarEntry, filter : EntryFilter) -> Bool

entry_origin

fn entry_origin(entry : HarEntry) -> String

entry_size_stats

fn entry_size_stats(entries : Array[HarEntry]) -> NumericStats

entry_time_stats

fn entry_time_stats(entries : Array[HarEntry]) -> NumericStats

escape_json

fn escape_json(text : String) -> String

events_at_or_after

fn events_at_or_after(events : Array[TimelineEvent], at : Int) -> Array[TimelineEvent]

events_for_entry

fn events_for_entry(events : Array[TimelineEvent], entry_index : Int) -> Array[TimelineEvent]

events_with_label

fn events_with_label(events : Array[TimelineEvent], label : String) -> Array[TimelineEvent]

export_diagnostics_json

fn export_diagnostics_json(diags : Array[Diagnostic]) -> String

export_domains_csv

fn export_domains_csv(summary : HarSummary) -> String

export_entries_csv

fn export_entries_csv(archive : HarArchive) -> String

export_entry_csv_row

fn export_entry_csv_row(entry : HarEntry, index : Int) -> String

export_full_report_json

fn export_full_report_json(archive : HarArchive) -> String

export_resources_csv

fn export_resources_csv(summary : HarSummary) -> String

export_slow_csv

fn export_slow_csv(summary : HarSummary) -> String

export_statuses_csv

fn export_statuses_csv(summary : HarSummary) -> String

export_waterfall_json

fn export_waterfall_json(rows : Array[WaterfallRow]) -> String

export_waterfall_row_json

fn export_waterfall_row_json(row : WaterfallRow) -> String

extract_domain

fn extract_domain(url : String) -> String

failed_readiness_items

fn failed_readiness_items(items : Array[ReadinessItem]) -> Array[ReadinessItem]

fastest_entry

fn fastest_entry(entries : Array[HarEntry]) -> HarEntry?

filter_entries

fn filter_entries(archive : HarArchive, filter : EntryFilter) -> Array[HarEntry]

first_entry_for_domain

fn first_entry_for_domain(archive : HarArchive, domain : String) -> HarEntry?

generate_insights

fn generate_insights(archive : HarArchive) -> Array[Insight]

grade_for_score

fn grade_for_score(score : Int) -> String

has_query_param

fn has_query_param(entry : HarEntry, name : String) -> Bool

header_value

fn header_value(headers : Array[HarPair], name : String) -> String?

heaviest_pattern

fn heaviest_pattern(patterns : Array[UrlPattern]) -> UrlPattern?

hottest_pattern

fn hottest_pattern(patterns : Array[UrlPattern]) -> UrlPattern?

insight_count_by_severity

fn insight_count_by_severity(insights : Array[Insight], severity : Severity) -> Int

is_cache_status

fn is_cache_status(status : Int) -> Bool

is_client_error_status

fn is_client_error_status(status : Int) -> Bool

is_redirect_status

fn is_redirect_status(status : Int) -> Bool

is_secure_url

fn is_secure_url(url : String) -> Bool

is_server_error_status

fn is_server_error_status(status : Int) -> Bool

is_success_status

fn is_success_status(status : Int) -> Bool

is_valid_archive

fn is_valid_archive(archive : HarArchive) -> Bool

last_entry_for_domain

fn last_entry_for_domain(archive : HarArchive, domain : String) -> HarEntry?

license_name

fn license_name() -> String

loosest_budget

fn loosest_budget() -> HarBudget

maintainer_email

fn maintainer_email() -> String

maintainer_name

fn maintainer_name() -> String

method_allows_body

fn method_allows_body(http_method : String) -> Bool

method_is_idempotent

fn method_is_idempotent(http_method : String) -> Bool

method_is_safe

fn method_is_safe(http_method : String) -> Bool

mobile_budget

fn mobile_budget() -> HarBudget

normalize_method

fn normalize_method(http_method : String) -> String

numeric_stats

fn numeric_stats(values : Array[Int]) -> NumericStats

p50_time

fn p50_time(entries : Array[HarEntry]) -> Int

p75_time

fn p75_time(entries : Array[HarEntry]) -> Int

p90_time

fn p90_time(entries : Array[HarEntry]) -> Int

p95_time

fn p95_time(entries : Array[HarEntry]) -> Int

p99_time

fn p99_time(entries : Array[HarEntry]) -> Int

package_banner

fn package_banner() -> String

package_keywords

fn package_keywords() -> Array[String]

package_name

fn package_name() -> String

parse_har

fn parse_har(text : String) -> Result[HarArchive, HarError]

parse_json

fn parse_json(text : String) -> Result[JVal, HarError]

payload_bytes

fn payload_bytes(entry : HarEntry) -> Int

percentile_nearest_rank

fn percentile_nearest_rank(values : Array[Int], percentile : Int) -> Int

profile_budget_matrix

fn profile_budget_matrix() -> Array[(String, HarBudget)]

profile_names

fn profile_names() -> Array[String]

project_name

fn project_name() -> String

quality_badges

fn quality_badges(score : QualityScore) -> Array[String]

query_param_value

fn query_param_value(entry : HarEntry, name : String) -> String?

readiness_check

fn readiness_check(archive : HarArchive) -> Array[ReadinessItem]

readiness_passed

fn readiness_passed(items : Array[ReadinessItem]) -> Bool

readiness_summary

fn readiness_summary(archive : HarArchive) -> String

receive_time_stats

fn receive_time_stats(entries : Array[HarEntry]) -> NumericStats

recommendation_for_summary

fn recommendation_for_summary(summary : HarSummary) -> Array[String]

redact_pair

fn redact_pair(pair : HarPair, policy : RedactionPolicy) -> HarPair

redact_pairs

fn redact_pairs(pairs : Array[HarPair], policy : RedactionPolicy) -> Array[HarPair]

redact_token_segments

fn redact_token_segments(url : String, replacement : String) -> String

redact_url

fn redact_url(url : String, policy : RedactionPolicy) -> String

relaxed_budget

fn relaxed_budget() -> HarBudget

render_budget_matrix

fn render_budget_matrix() -> String

render_budget_result

fn render_budget_result(result : BudgetResult) -> String

render_diagnostics

fn render_diagnostics(diags : Array[Diagnostic]) -> String

Render validation diagnostics as newline separated text.

render_diff

fn render_diff(diff : SummaryDiff) -> String

render_insights

fn render_insights(insights : Array[Insight]) -> String

render_numeric_stats

fn render_numeric_stats(name : String, stats : NumericStats) -> String

render_profiles

fn render_profiles() -> String

render_quality

fn render_quality(score : QualityScore) -> String

render_readiness

fn render_readiness(items : Array[ReadinessItem]) -> String

render_recommendations

fn render_recommendations(summary : HarSummary) -> String

render_redacted_slow_entries

fn render_redacted_slow_entries(summary : HarSummary, policy : RedactionPolicy) -> String

render_summary

fn render_summary(summary : HarSummary) -> String

Render a compact human readable summary.

render_summary_json

fn render_summary_json(summary : HarSummary) -> String

Render a compact JSON-like report without depending on a JSON encoder.

render_timeline

fn render_timeline(events : Array[TimelineEvent]) -> String

render_url_patterns

fn render_url_patterns(patterns : Array[UrlPattern]) -> String

render_waterfall_table

fn render_waterfall_table(rows : Array[WaterfallRow]) -> String

replace_domain

fn replace_domain(url : String, replacement : String) -> String

repository_url

fn repository_url() -> String

request_accept

fn request_accept(entry : HarEntry) -> String

request_overhead_bytes

fn request_overhead_bytes(entry : HarEntry) -> Int

resource_count

fn resource_count(summary : HarSummary, kind : String) -> Int

resource_delta

fn resource_delta(before : HarSummary, after : HarSummary, kind : String) -> Int

resource_kind

fn resource_kind(mime : String, url : String) -> String

response_overhead_bytes

fn response_overhead_bytes(entry : HarEntry) -> Int

row_receive_ratio

fn row_receive_ratio(row : WaterfallRow) -> Int

row_wait_ratio

fn row_wait_ratio(row : WaterfallRow) -> Int

rows_after

fn rows_after(rows : Array[WaterfallRow], offset : Int) -> Array[WaterfallRow]

rows_for_domain

fn rows_for_domain(rows : Array[WaterfallRow], domain : String) -> Array[WaterfallRow]

rows_for_kind

fn rows_for_kind(rows : Array[WaterfallRow], kind : String) -> Array[WaterfallRow]

same_origin

fn same_origin(left : String, right : String) -> Bool

sample_har

fn sample_har() -> String

score_archive

fn score_archive(archive : HarArchive) -> QualityScore

select_by_mime_prefix

fn select_by_mime_prefix(archive : HarArchive, prefix : String) -> Array[HarEntry]

select_by_status

fn select_by_status(archive : HarArchive, status : Int) -> Array[HarEntry]

select_by_status_range

fn select_by_status_range(archive : HarArchive, min : Int, max : Int) -> Array[HarEntry]

select_by_url_prefix

fn select_by_url_prefix(archive : HarArchive, prefix : String) -> Array[HarEntry]

select_by_url_suffix

fn select_by_url_suffix(archive : HarArchive, suffix : String) -> Array[HarEntry]

select_empty_responses

fn select_empty_responses(archive : HarArchive) -> Array[HarEntry]

select_insecure_requests

fn select_insecure_requests(archive : HarArchive) -> Array[HarEntry]

select_large_responses

fn select_large_responses(archive : HarArchive, min_bytes : Int) -> Array[HarEntry]

select_post_bodies

fn select_post_bodies(archive : HarArchive) -> Array[HarEntry]

select_secure_requests

fn select_secure_requests(archive : HarArchive) -> Array[HarEntry]

select_wait_bound

fn select_wait_bound(archive : HarArchive, min_ratio : Int) -> Array[HarEntry]

severity_text

fn severity_text(severity : Severity) -> String

slowest_entry

fn slowest_entry(entries : Array[HarEntry]) -> HarEntry?

ssl_time_stats

fn ssl_time_stats(entries : Array[HarEntry]) -> NumericStats

status_family_label

fn status_family_label(status : Int) -> String

status_group

fn status_group(status : Int) -> String

strictest_budget

fn strictest_budget() -> HarBudget

strip_query

fn strip_query(url : String) -> String

submission_identity

fn submission_identity() -> String

sum_known_timings

fn sum_known_timings(t : HarTimings) -> Int

summary_line

fn summary_line(summary : HarSummary) -> String

timeline_event_count_for_label

fn timeline_event_count_for_label(events : Array[TimelineEvent], label : String) -> Int

timeline_span

fn timeline_span(events : Array[TimelineEvent]) -> Int

timing_breakdown

fn timing_breakdown(entry : HarEntry) -> String

total_entry_bytes

fn total_entry_bytes(entries : Array[HarEntry]) -> Int

total_entry_time

fn total_entry_time(entries : Array[HarEntry]) -> Int

unique_domains

fn unique_domains(archive : HarArchive) -> Array[String]

unique_methods

fn unique_methods(archive : HarArchive) -> Array[String]

unique_resource_kinds

fn unique_resource_kinds(archive : HarArchive) -> Array[String]

url_path

fn url_path(url : String) -> String

url_pattern

fn url_pattern(url : String) -> String

url_scheme

fn url_scheme(url : String) -> String

validate_archive

fn validate_archive(archive : HarArchive) -> Array[Diagnostic]

Validate an archive and return all findings.

wait_time_stats

fn wait_time_stats(entries : Array[HarEntry]) -> NumericStats

waterfall_total_duration

fn waterfall_total_duration(rows : Array[WaterfallRow]) -> Int