toJson method

Map<String, dynamic> toJson()

Machine readable form used by distribute run --json.

Implementation

Map<String, dynamic> toJson() => {
      'task': taskKey,
      'job': jobLabel,
      'ref': ref,
      'status': succeeded
          ? 'success'
          : ignored
              ? 'failed-ignored'
              : 'failed',
      'exit-code': exitCode,
      'duration-ms': duration.inMilliseconds,
      'attempts': attempts,
      if (resumed) 'resumed': true,
      if (artifacts.isNotEmpty)
        'artifacts': artifacts.map((a) => a.toJson()).toList(),
    };