How to use the systeminformation.cpu function in systeminformation

To help you get started, we’ve selected a few systeminformation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Polymer / tachometer / src / json-output.ts View on Github external
export async function legacyJsonOutput(results: BenchmarkResult[]):
    Promise {
  // TODO Add git info.
  const battery = await systeminformation.battery();
  const cpu = await systeminformation.cpu();
  const currentLoad = await systeminformation.currentLoad();
  const memory = await systeminformation.mem();
  return {
    benchmarks: results,
    datetime: new Date().toISOString(),
    system: {
      cpu: {
        manufacturer: cpu.manufacturer,
        model: cpu.model,
        family: cpu.family,
        speed: cpu.speed,
        cores: cpu.cores,
      },
      load: {
        average: currentLoad.avgload,
        current: currentLoad.currentload,
github EnKrypt / Doppler / backend / src / app.ts View on Github external
(async () => {
    system = await SI.system();
    cpu = await SI.cpu();
    os = await SI.osInfo();

    setInterval(poll, argv.i);

    app.listen(argv.p);

    console.log(`Doppler running on port ${argv.p}`);
})();
github oguzhaninan / Stacer / src / components / dashboard / SystemInfo.js View on Github external
si.osInfo(o => {
      this.information.push(lang('hostname') + ': ' + isUndefined(o.hostname))
      this.information.push(lang('platform') + ': ' + isUndefined(o.platform) + " " + isUndefined(o.arch))
      this.information.push(lang('distribution') + ': ' + isUndefined(o.distro) + " " + isUndefined(o.release))
      this.information.push(lang('kernelRel') + ': ' + isUndefined(o.kernel))
      si.cpu(c => {
        this.information.push(lang('cpuModel') + ': ' + isUndefined(c.manufacturer) + " " + isUndefined(c.brand))
        this.information.push(lang('cpuSpeed') + ': ' + isUndefined(c.speed) + "GHz")
        this.information.push(lang('cpuCores') + ': ' + c.cores)
      })
    })
  }
github RocketChat / Rocket.Chat.Apps-cli / src / misc / cloudAuth.ts View on Github external
private async getEncryptionKey(): Promise {
        const s = await system();
        const c = await cpu();
        const m = await mem();
        const o = await osInfo();

        return s.manufacturer + ';' + s.uuid + ';' + String(c.processors) + ';'
                + c.vendor + ';' + m.total + ';' + o.platform + ';' + o.release;
    }
github GoogleChromeLabs / carlo / examples / systeminfo / app.js View on Github external
async function systeminfo() {
  const info = {};
  await Promise.all([
    si.battery().then(r => info.battery = r),
    si.cpu().then(r => info.cpu = r),
    si.osInfo().then(r => info.osInfo = r),
  ]);
  return info;
}
github dreamnettech / dreamtime / src / electron / src / modules / tools / system.js View on Github external
async setup() {
    const [
      graphics,
      os,
      cpu,
      mem,
      online,
    ] = await Promise.all([
      si.graphics(),
      si.osInfo(),
      si.cpu(),
      si.mem(),
      isOnline(),
    ])

    this._graphics = graphics
    this.os = os
    this.cpu = cpu
    this.memory = mem
    this.online = online

    logger.info(`GPU devices: ${this.graphics.length}`)
    logger.info(`RAM: ${this.memory.total} bytes.`)
    logger.info(`Internet connection: ${this.online}`)
    logger.debug(this)
  }
github staart / api / src / helpers / utils.ts View on Github external
export const getSystemInformation = async () => {
  return {
    system: await systemInfo.system(),
    time: systemInfo.time(),
    cpu: await systemInfo.cpu(),
    osInfo: await systemInfo.osInfo(),
    package: {
      name: pkg.name,
      version: pkg.version,
      repository: pkg.repository,
      author: pkg.author,
      "staart-version": pkg["staart-version"]
    }
  };
};
github ottomatica / opunit / lib / harness / local.js View on Github external
async getCPUCores(_context) {
        return (await si.cpu()).cores;
    }