Skip to content

Commit a4de6d1

Browse files
author
Lasim
committed
docs(satellite): update example outputs in token counter utility
1 parent f11c7df commit a4de6d1

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

services/satellite/src/utils/token-counter.example.ts

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ export function exampleEstimateDiscoveredTools() {
5353

5454
const estimate = estimateMcpServerTokens(server);
5555

56-
console.log(`Server ${estimate.serverName}:`);
57-
console.log(` Tools: ${estimate.toolCount}`);
58-
console.log(` Total Tokens: ${estimate.totalTokens}`);
59-
console.log(` Complexity: ${estimate.complexity}`);
56+
// Example output:
57+
// Server filesystem-team-abc123:
58+
// Tools: 2
59+
// Total Tokens: 150
60+
// Complexity: low
6061

6162
return estimate;
6263
}
@@ -107,10 +108,11 @@ export function exampleAnalyzeMultipleTeams() {
107108
// Analyze with default 200k context window (Claude Sonnet 4.5)
108109
const analysis = analyzeContextWindowUsage([team1Server, team2Server]);
109110

110-
console.log(`Total servers: ${analysis.totalServers}`);
111-
console.log(`Total tools: ${analysis.totalTools}`);
112-
console.log(`Context usage: ${analysis.utilizationPercent}%`);
113-
console.log(`Recommendation: ${analysis.recommendation}`);
111+
// Example output:
112+
// Total servers: 2
113+
// Total tools: 2
114+
// Context usage: 0.5%
115+
// Recommendation: Excellent - context window usage is minimal
114116

115117
return analysis;
116118
}
@@ -155,13 +157,16 @@ export function exampleCalculateHierarchicalSavings() {
155157

156158
const savings = calculateHierarchicalSavings(servers);
157159

158-
console.log('Traditional approach:');
159-
console.log(` ${savings.traditionalApproach.totalTools} tools exposed`);
160-
console.log(` ${savings.traditionalApproach.totalTokens} tokens`);
161-
console.log('\nHierarchical approach:');
162-
console.log(` ${savings.hierarchicalApproach.exposedTools} meta-tools exposed`);
163-
console.log(` ${savings.hierarchicalApproach.totalTokens} tokens`);
164-
console.log(`\nSavings: ${savings.savings.percent}% reduction`);
160+
// Example output:
161+
// Traditional approach:
162+
// 35 tools exposed
163+
// 2500 tokens
164+
//
165+
// Hierarchical approach:
166+
// 2 meta-tools exposed
167+
// 350 tokens
168+
//
169+
// Savings: 86% reduction
165170

166171
return savings;
167172
}
@@ -217,7 +222,8 @@ export async function exampleIntegrateWithToolDiscovery() {
217222
}
218223
*/
219224

220-
console.log('See comments above for integration pattern');
225+
// See comments above for integration pattern
226+
return null;
221227
}
222228

223229
/**
@@ -242,13 +248,15 @@ export function exampleCustomContextWindow() {
242248

243249
// For Claude Sonnet 4.5 (200k)
244250
const claudeAnalysis = analyzeContextWindowUsage([server], 200000);
245-
console.log(`Claude Sonnet 4.5: ${claudeAnalysis.utilizationPercent}%`);
251+
// Example: Claude Sonnet 4.5: 0.05%
246252

247253
// For GPT-4 (128k)
248254
const gpt4Analysis = analyzeContextWindowUsage([server], 128000);
249-
console.log(`GPT-4: ${gpt4Analysis.utilizationPercent}%`);
255+
// Example: GPT-4: 0.08%
250256

251257
// For Gemini 2.0 (1M)
252258
const geminiAnalysis = analyzeContextWindowUsage([server], 1000000);
253-
console.log(`Gemini 2.0: ${geminiAnalysis.utilizationPercent}%`);
259+
// Example: Gemini 2.0: 0.01%
260+
261+
return { claudeAnalysis, gpt4Analysis, geminiAnalysis };
254262
}

0 commit comments

Comments
 (0)