% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diagnostics.R
\name{report}
\alias{report}
\title{Generate Shard Runtime Report}
\usage{
report(level = c("summary", "workers", "tasks", "segments"), result = NULL)
}
\arguments{
\item{level}{Character. Detail level for the report:
\itemize{
\item \code{"summary"}: High-level overview (default)
\item \code{"workers"}: Include per-worker details
\item \code{"tasks"}: Include task execution history
\item \code{"segments"}: Include shared memory segment details
}}

\item{result}{Optional. A \code{shard_result} object from \code{\link{shard_map}}
to include execution diagnostics from.}
}
\value{
An S3 object of class \code{shard_report} containing:
\itemize{
\item \code{level}: The requested detail level
\item \code{timestamp}: When the report was generated
\item \code{pool}: Pool status information (if pool exists)
\item \code{memory}: Memory usage summary
\item \code{workers}: Per-worker details (if level includes workers)
\item \code{tasks}: Task execution details (if level includes tasks)
\item \code{segments}: Segment details (if level includes segments)
\item \code{result_diagnostics}: Diagnostics from shard_result (if provided)
}
}
\description{
Primary entry point for shard diagnostics. Generates a comprehensive report
of the current runtime state including pool status, memory usage, and
execution statistics.
}
\examples{
\donttest{
res <- shard_map(shards(100, workers = 2), function(s) sum(s$idx), workers = 2)
pool_stop()
report(result = res)
}
}
