<commit_before>package model

import util.StringUtils._
import util.momentJs.Moment

/**
 * This models match with the Json coming from the Docker Remote API.
 * Note: Docker Api use upper camel case, using here the same to make parsing easier.
 */


case class Connection(url: String) {
  import util.StringUtils._
  def ip = substringBefore(substringAfter(url, "://"), ":")
}

case class DockerMetadata(connection: Connection,
                          info: Info,
                          version: Version,
                          containers: Seq[Container]) {

  def totalContainersSize = bytesToSize(containers.map(c => c.SizeRootFs + c.SizeRw).sum)
}

case class Info(Containers: Int,
                Driver: String,
                ExecutionDriver: String,
                Images: Int,
                IndexServerAddress: String,
                InitPath: String,
                KernelVersion: String,
                MemTotal: Float,
                NEventsListener: Int,
                NGoroutines: Int,
                OperatingSystem: String)

case class Version(ApiVersion: String,
                   Arch: String,
                   GitCommit: String,
                   GoVersion: String,
                   KernelVersion: String,
                   Os: String,
                   Version: String) {<commit_msg>Fix incorrect summarized size for containers and images. Ref #12<commit_after>package model

import util.StringUtils._
import util.momentJs.Moment

/**
 * This models match with the Json coming from the Docker Remote API.
 * Note: Docker Api use upper camel case, using here the same to make parsing easier.
 */


case class Connection(url: String) {
  import util.StringUtils._
  def ip = substringBefore(substringAfter(url, "://"), ":")
}

case class DockerMetadata(connection: Connection,
                          info: Info,
                          version: Version,
                          containers: Seq[Container]) {

  def totalContainersSize = bytesToSize(containers.map(c => c.SizeRootFs.toLong + c.SizeRw.toLong).sum)
}

case class Info(Containers: Int,
                Driver: String,
                ExecutionDriver: String,
                Images: Int,
                IndexServerAddress: String,
                InitPath: String,
                KernelVersion: String,
                MemTotal: Float,
                NEventsListener: Int,
                NGoroutines: Int,
                OperatingSystem: String)

case class Version(ApiVersion: String,
                   Arch: String,
                   GitCommit: String,
                   GoVersion: String,
                   KernelVersion: String,
                   Os: String,
                   Version: String) {
{'fraction_non_alphanumeric': 0.07779816513761467, 'fraction_numerical': 0.0007339449541284404, 'mean_word_length': 1.7124378109452736, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4130307', 'n_tokens_mistral': 702, 'n_tokens_neox': 649, 'n_words': 203}