% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/altrep.R
\name{shared_diagnostics}
\alias{shared_diagnostics}
\title{Get diagnostics for a shared vector}
\usage{
shared_diagnostics(x)
}
\arguments{
\item{x}{A shard ALTREP vector}
}
\value{
A list with diagnostic information:
\describe{
\item{dataptr_calls}{Number of times DATAPTR was accessed}
\item{materialize_calls}{Number of times vector was copied to standard R vector}
\item{length}{Number of elements}
\item{offset}{Byte offset into underlying segment}
\item{readonly}{Whether write access is prevented}
\item{type}{R type of the vector}
}
}
\description{
Get diagnostics for a shared vector
}
\examples{
\donttest{
seg <- segment_create(400)
segment_write(seg, 1:100, offset = 0)
x <- shared_vector(seg, "integer", length = 100)

sum(x)

shared_diagnostics(x)
}
}
