@@ -11,6 +11,7 @@ import type { readAdoptionPage } from "../lib/adoption-request.mjs";
1111import {
1212 adoptionGrowthForRange ,
1313 adoptionPaths ,
14+ dailyActivityForRange ,
1415 daysBefore ,
1516 periodOffset ,
1617 thresholds ,
@@ -59,13 +60,10 @@ const directoryFallback = ranked == null && requestedDirectoryDays === 30;
5960const summary = selfHosted .totals ?.find (
6061 ({ range_days , comparison }) => range_days === days && comparison === " current" ,
6162);
62- const latestAccounts = selfHosted .activity
63- .filter (
64- ({ grain , period , active_accounts }) =>
65- grain === " day" && period >= cutoff && period < today && Number .isFinite (active_accounts ),
66- )
67- .sort ((left , right ) => right .period .localeCompare (left .period ))
68- .at (0 );
63+ const accountReports = dailyActivityForRange (selfHosted .activity , " active_accounts" , cutoff , today );
64+ const firstAccounts = accountReports [0 ];
65+ const latestAccounts = accountReports .at (- 1 );
66+ const latestInstances = dailyActivityForRange (selfHosted .activity , " serving_processes" , cutoff , today ).at (- 1 );
6967const overview = [
7068 {
7169 label: " Active domains" ,
@@ -83,11 +81,17 @@ const overview = [
8381 note: latestAccounts ? ` Reported ${showDay (latestAccounts .period )} UTC ` : " User data unavailable" ,
8482 },
8583 { label: " Active installations" , value: summary ?.active , note: " At least one successful request" },
84+ {
85+ label: " Active instances" ,
86+ value: latestInstances ?.serving_processes ,
87+ note: latestInstances ? ` Reported ${showDay (latestInstances .period )} UTC ` : " Instance data unavailable" ,
88+ },
8689 { label: " Successful requests" , value: summary ?.operations , note: " Across all Loom features" },
8790];
8891
8992const growthMetrics = [
9093 { value: " installations" , label: " Installations" },
94+ { value: " instances" , label: " Instances" },
9195 { value: " accounts" , label: " Users" },
9296 { value: " requests" , label: " Requests" },
9397] as const ;
@@ -182,12 +186,10 @@ const sdkSeries = groupDailySeries(selectedSdk?.history ?? [], grain, { start: c
182186const stars = oss .find (({ id }) => id === " stars" );
183187const starSeries = groupDailySeries (stars ?.history ?? [], grain , {
184188 start: cutoff ,
185- end: daysBefore ( today , - 1 ) ,
189+ end: today ,
186190 kind: " gauge" ,
187- }).map ((point ) => ({
188- ... point ,
189- current: point .current || (stars ?.day === today && point .day === periodStart (today , grain )),
190- }));
191+ includeCurrent: true ,
192+ });
191193const distribution = oss .filter (({ id }) => id === " releases" || id === " pulls" );
192194const selectedDistribution =
193195 distribution .find (({ id }) => id === input (" distribution" )) ??
@@ -197,6 +199,7 @@ const distributionSeries = groupDailySeries(selectedDistribution?.history ?? [],
197199 start: cutoff ,
198200 end: today ,
199201 kind: " gauge" ,
202+ includeCurrent: true ,
200203});
201204const moreSdks = [
202205 [" Go SDK" , " /docs/reference/go-sdk" ],
@@ -284,7 +287,14 @@ const state = Object.fromEntries(
284287 </form >
285288 { selectedGrowth === " installations"
286289 ? <AdoptionGrowth rows = { growth } { grain } rangeStart = { cutoff } rangeEnd = { lastDay } />
287- : <AdoptionActivity rows = { events } { grain } view = { selectedGrowth } rangeStart = { cutoff } rangeEnd = { lastDay } />}
290+ : <AdoptionActivity
291+ rows = { events }
292+ { grain }
293+ view = { selectedGrowth }
294+ rangeStart = { cutoff }
295+ rangeEnd = { lastDay }
296+ firstAccountReport = { firstAccounts && showDay (firstAccounts .period )}
297+ />}
288298 </section >
289299
290300 <AdoptionDomainDirectory
@@ -433,19 +443,22 @@ const state = Object.fromEntries(
433443 <section class = " adoption-section" id = " repository" aria-labelledby = " repository-title" >
434444 <div class = " section-heading" >
435445 <Title type = " h2" size = " lg" id = " repository-title" >GitHub stars</Title >
436- { starSeries .length > 0 && <AdoptionDownload { path } { state } dataset = " stars" label = " Export stars CSV" />}
446+ { stars ?.history .some (({ reconstructed }) => ! reconstructed ) &&
447+ <AdoptionDownload { path } { state } dataset = " stars" label = " Export UTC totals CSV" />}
437448 </div >
438449 <Panel className = " stars-chart" orientation = " vertical" alignItems = " start" padding = " lg" gap = " xs" hasBorder fillWidth >
439450 <AdoptionTrend
440451 label = " GitHub stars over time"
441452 rows = { starSeries }
442453 { grain }
443454 mode = " line"
444- fitObservedRange
445455 axisStart = { periodStart (cutoff , grain )}
446456 axisEnd = { periodStart (stars ?.day === today ? today : lastDay , grain )}
447457 emptyMessage = " Star history is unavailable for this window."
448458 />
459+ { stars ?.history .some (({ reconstructed }) => reconstructed ) && (
460+ <Text size = " sm" color = " muted" >Earlier points use GitHub’s daily star counts and reporting calendar.</Text >
461+ )}
449462 </Panel >
450463 </section >
451464
@@ -472,7 +485,7 @@ const state = Object.fromEntries(
472485 { grain }
473486 kind = " gauge"
474487 axisStart = { cutoff }
475- axisEnd = { lastDay }
488+ axisEnd = { selectedDistribution . day === today ? today : lastDay }
476489 observedLabel = " Cumulative snapshot"
477490 growthLabel = { " Net change per " + grain }
478491 />
@@ -501,7 +514,7 @@ const state = Object.fromEntries(
501514 .adoption-window { display: grid; gap: 0.2rem; text-align: end; }
502515 .overview { margin-block-end: clamp(1.35rem, 3vw, 2.25rem); }
503516 .metrics, .sdk-metrics, .two-column { display: grid; gap: 0.75rem; }
504- .metrics { grid-template-columns: repeat(4 , minmax(0, 1fr)); }
517+ .metrics { grid-template-columns: repeat(5 , minmax(0, 1fr)); }
505518 .sdk-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
506519 .counters, .two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
507520 .two-column > :only-child { grid-column: 1 / -1; }
@@ -534,7 +547,10 @@ const state = Object.fromEntries(
534547 .sdk-list { display: flex; flex-wrap: wrap; gap: 0 1rem; list-style: none; padding: 0; margin-block: 0.65rem 0; }
535548 .sdk-list :global(a) { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
536549 .adoption-cta { margin-block-start: clamp(1.4rem, 3vw, 2.75rem); }
537- @media (max-width: 60rem) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
550+ @media (max-width: 60rem) {
551+ .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
552+ .metrics > :last-child { grid-column: 1 / -1; }
553+ }
538554 @media (max-width: 43rem) { .two-column, .sdk-metrics { grid-template-columns: minmax(0, 1fr); } }
539555 @media (max-width: 38rem) { .adoption-window { text-align: start; } }
540556 @media (max-width: 26rem) {
0 commit comments