diagnosing-endpoint-performance
यह क्या करती है
यह स्किल एक खास एंडपॉइंट को देखती है जो धीमा है, टाइम आउट होता है, या बहुत ज़्यादा खर्च करवाता है, और ठोस सुधार सुझाती है। यह उन लोगों के लिए है जो PostHog एंडपॉइंट चलाते हैं और तेज़ या सस्ते नतीजे चाहते हैं।
कब इस्तेमाल करें
- ✓जब कोई एंडपॉइंट धीमा हो या बार-बार टाइम आउट हो और आप कारण जानना चाहें।
- ✓जब किसी एंडपॉइंट की लागत सीमा तक पहुँच रही हो और आपको लागत घटानी हो।
- ✓जब आप निश्चित न हों कि कोई एंडपॉइंट मैटेरियलाइज़्ड व्यू के रूप में सहेजा जाना चाहिए या नहीं।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/diagnosing-endpoint-performance/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा सेल्स एंडपॉइंट हर सुबह टाइम आउट हो जाता है। पता लगाइए कि क्यों, और क्या बदलना चाहिए?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह एंडपॉइंट की कॉन्फ़िगरेशन, संस्करण इतिहास और मैटेरियलाइज़ेशन की स्थिति जाँचती है, फिर कोई बदलाव सुझाती है, जैसे लंबी कैश अवधि, संग्रहीत नतीजे या सरल क्वेरी।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Diagnosing endpoint performance
This skill walks through a specific endpoint that is slow, expensive, or unreliable, and produces
a concrete recommendation. It is the deep-dive counterpart to auditing-endpoints (which finds
candidates).
When to use this skill
- "This endpoint is slow / timing out"
- "Why is my endpoint hitting the cost cap?"
- "Should I materialise X?"
- An endpoint surfaced from
auditing-endpointsas a failing materialisation or expensive caller - The user has a specific endpoint in mind and wants advice
If the question is project-wide ("what should I clean up?"), use auditing-endpoints first.
Available tools
| Tool | Purpose |
|---|---|
endpoint-get |
Full endpoint config: query, current version, data_freshness_seconds, materialisation status |
endpoint-versions |
History of every version (query + materialisation state); which version is current |
endpoint-materialization-status |
Whether materialisation is eligible, current state, last run, last error |
endpoints-materialization-preview |
What the materialised query would look like, plus the rejection reason if ineligible |
endpoints-last-execution-times |
When was it last called (endpoint-level sanity-check that it is in active use) |
execute-sql |
Query query_log for endpoint-level call frequency and per-call duration/bytes |
The decision tree
When deciding what to recommend, walk these in order — the first one that applies is the cheapest fix.
Step 1 — Is it cached at all?
Fetch the endpoint and look at data_freshness_seconds (it sets both the cache TTL and, when
materialised, the refresh cadence). If the user's traffic
calls the same parameters repeatedly within that window, every call after the first is a cache
hit and effectively free.
- TTL is at the default (24h / 86400s) and the data really doesn't need fresher than that → done, no change needed.
- TTL is at the 900s floor (15 min) and the user is hitting the endpoint many times per minute →
bump the TTL. This is almost always the cheapest first move. (
data_freshness_secondsis an enum: 900, 1800, 3600, 21600, 43200, 86400, 604800 — there is no sub-15-minute value.) - TTL is at the floor because the data must be fresh (e.g. real-time dashboard) → cache won't help, skip to step 2.
The shape of the variables matters here: if every call passes different user_id or date_from
values, the cache has many distinct keys and a higher TTL helps less. If almost every call uses
the same handful of parameter combinations, the cache helps a lot.
Step 2 — Should it be materialised?
Materialisation pre-computes the query into a saved view that's refreshed on a schedule. Reads become near-instant — at the cost of staleness equal to the refresh interval, plus storage and compute for the materialisation itself.
Call endpoints-materialization-preview. The response tells you:
- Eligible + clean transform → strong candidate. Recommend enabling, especially for endpoints with predictable filter shapes (variables, breakdowns).
- Not eligible, with a rejection reason → cannot materialise. The reason often hints at the next step (see step 3 — rewrite).
- Eligible but the transform is gnarly (lots of range pairs, complex aggregation re-derivation) → materialisation will work but may not save much. Worth flagging before flipping the switch.
When materialisation is enabled, callers must pass all materialised variables — calls without them are rejected (security: prevents returning unfiltered data). Pair the recommendation with a note about which variables become required.
Step 3 — Does the query need rewriting?
For a SQL endpoint that isn't eligible, the rejection reason from
endpoints-materialization-preview is the lead. That tool always resolves. Read the reason and
match it to the bullets below — they summarise the common cases, not every check the server runs,
so the raw reason wins when the two disagree. Propose the rewrite by hand:
- Cohort breakdown / compare mode rejection → regular property breakdowns materia
अक्सर पूछे जाने वाले सवाल
क्या यह पूरे प्रोजेक्ट को देखती है?
नहीं। यह एक नामित एंडपॉइंट पर केंद्रित है, और पूरे प्रोजेक्ट की समीक्षा के लिए एक अलग ऑडिट स्किल है।
मैटेरियलाइज़ेशन क्या है?
यह एंडपॉइंट के नतीजों को एक टेबल में संग्रहीत करता है, ताकि बार-बार की कॉल तेज़ हों, पर इसकी कीमत स्टोरेज और कंप्यूट है।
ऑडिट स्किल कब इस्तेमाल करूँ?
जब आप पूरे प्रोजेक्ट में यह देखना चाहें कि कौन से एंडपॉइंट साफ़ करने हैं।
जानकारी
लेखक का मूल विवरण
Diagnose why a PostHog endpoint is slow or expensive and propose a concrete fix — bump the cache TTL, enable materialisation, restructure variables, or rewrite the query. Use when the user says "this endpoint is slow", "my endpoint times out", "we're hitting the cost cap on this one", or asks "should I materialise this?". Focuses on a single named endpoint, not a project-wide audit.
repo: PostHog/posthog
लोकप्रियता
- GitHub स्टार
- 41k
- रैंकिंग में स्थान
- #6861
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
clickhouse-io
280kआपके एजेंट को ClickHouse databases में queries और schemas optimize करने में मदद करता है। high-performance analytical workloads के लिए best practices लागू करता है। जब analytical queries बहुत धीमी हों, तब इसका उपयोग करें।
scientific-db-pubmed-database
280kआपके एजेंट को बायोमेडिकल क्षेत्र के वैज्ञानिक लेख खोजने में मदद करता है। जिस रिसर्च में खास मेडिकल जानकारी चाहिए, उसके लिए यह काम का है।