feat: add PDF render timing to convert and demo routes
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 1m42s
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 1m42s
- renderPdf() and renderUrlPdf() now return { pdf, durationMs }
- Timing wraps the actual render with Date.now()
- Log render duration via logger.info
- Add X-Render-Time response header in convert and demo routes
- Update all callers in convert, demo, templates routes
- Add TDD tests in render-timing.test.ts
- Update existing test mocks for new return shape
This commit is contained in:
parent
0283e9dae8
commit
f9caef82e6
13 changed files with 165 additions and 23 deletions
|
|
@ -56,8 +56,8 @@ vi.mock("../services/keys.js", () => {
|
|||
vi.mock("../services/browser.js", () => ({
|
||||
initBrowser: vi.fn().mockResolvedValue(undefined),
|
||||
closeBrowser: vi.fn().mockResolvedValue(undefined),
|
||||
renderPdf: vi.fn().mockResolvedValue(Buffer.from("%PDF-1.4 mock pdf content here")),
|
||||
renderUrlPdf: vi.fn().mockResolvedValue(Buffer.from("%PDF-1.4 mock url pdf content")),
|
||||
renderPdf: vi.fn().mockResolvedValue({ pdf: Buffer.from("%PDF-1.4 mock pdf content here"), durationMs: 10 }),
|
||||
renderUrlPdf: vi.fn().mockResolvedValue({ pdf: Buffer.from("%PDF-1.4 mock url pdf content"), durationMs: 10 }),
|
||||
getPoolStats: vi.fn().mockReturnValue({
|
||||
poolSize: 16,
|
||||
totalPages: 16,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue