refactor: rename formatMemoryUsage to formatBytes (#14997)

Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
This commit is contained in:
Mark Cockram
2026-01-27 17:21:53 +01:00
committed by GitHub
parent 362384112e
commit db028bc19a
9 changed files with 22 additions and 22 deletions

View File

@@ -11,7 +11,7 @@ import { bugCommand } from './bugCommand.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { getVersion } from '@google/gemini-cli-core';
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
import { formatMemoryUsage } from '../utils/formatters.js';
import { formatBytes } from '../utils/formatters.js';
// Mock dependencies
vi.mock('open');
@@ -68,7 +68,7 @@ vi.mock('../utils/terminalCapabilityManager.js', () => ({
describe('bugCommand', () => {
beforeEach(() => {
vi.mocked(getVersion).mockResolvedValue('0.1.0');
vi.mocked(formatMemoryUsage).mockReturnValue('100 MB');
vi.mocked(formatBytes).mockReturnValue('100 MB');
vi.stubEnv('SANDBOX', 'gemini-test');
vi.useFakeTimers();
vi.setSystemTime(new Date('2024-01-01T00:00:00Z'));

View File

@@ -13,7 +13,7 @@ import {
} from './types.js';
import { MessageType } from '../types.js';
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
import { formatMemoryUsage } from '../utils/formatters.js';
import { formatBytes } from '../utils/formatters.js';
import {
IdeClient,
sessionId,
@@ -45,7 +45,7 @@ export const bugCommand: SlashCommand = {
}
const modelVersion = config?.getModel() || 'Unknown';
const cliVersion = await getVersion();
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
const memoryUsage = formatBytes(process.memoryUsage().rss);
const ideClient = await getIdeClientName(context);
const terminalName =
terminalCapabilityManager.getTerminalName() || 'Unknown';