(containerNames: string[])
| 238 | } |
| 239 | |
| 240 | export function dockerStatsForContainers(containerNames: string[]): string { |
| 241 | if (containerNames.length === 0) return '' |
| 242 | return execSync( |
| 243 | `docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}" ${containerNames.join(' ')}`, |
| 244 | { stdio: 'pipe' }, |
| 245 | ).toString() |
| 246 | } |
| 247 | |
| 248 | export function dockerExec(containerName: string, cmd: string): string { |
| 249 | return execSync(`docker exec ${containerName} ${cmd}`, { |
no outgoing calls
no test coverage detected