:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { logRecordSizeBytes } from './log-record-size'
describe('logRecordSizeBytes', () => {
it.each([
[{ body: null, severity_text: null, attributes: null, resource_attributes: null }, 0],
[{ body: '', severity_text: '', attributes: {}, resource_attributes: {} }, 0],
[{ body: '😀', severity_text: 'é', attributes: { 漢: '"✓"' }, resource_attributes: { r: 'true' } }, 19],
])('counts UTF-8 string and map content for %j', (record, expected) => {
expect(logRecordSizeBytes(record)).toBe(expected)
})
})