Exemplo n.º 1
0
def printParms(fmt, disk, raid, rados, site, multi):
    """
        print out the parameters associated with a test
    """
    if disk is not None:
        print "Disk Modeling Parameters"
        print "    size:     %10s" % fmt.printSize(disk.size)
        print("    FIT rate: %10d (MTBF = %s)" %
              (disk.fits, fmt.printTime(mttf(disk.fits))))
        print "    NRE rate: %10.1E" % disk.nre

    if raid is not None:
        print "RAID parameters"
        print "    replace:  %16s" % fmt.printTime(raid.delay)
        if raid.speed > 0:
            print("    recovery rate: %7s/s (%s)" %
                  (fmt.printSize(raid.speed),
                   fmt.printTime(raid.rebuild_time())))
        print "    NRE model:        %10s" % raid.nre_model
        print "    object size:      %10s" % fmt.printSize(raid.objsize)

    if rados is not None:
        print "RADOS parameters"
        print "    auto mark-out: %14s" % fmt.printTime(rados.delay)
        print("    recovery rate: %8s/s (%s/drive)" %
              (fmt.printSize(rados.speed),

               fmt.printTime(rados.rebuild_time(rados.speed))))
        print "    osd fullness: %7d%%" % (rados.full * 100)
        print "    declustering: %7d PG/OSD" % rados.pgs
        print "    NRE model:        %10s" % rados.nre_model
        print "    object size:  %7s" % \
              fmt.printSize(rados.objsize, unit=1024)
        print "    stripe length:%7d" % rados.stripe

    if site is not None:
        print "Site parameters"
        s = 0 if multi is None else multi.sites
        if site.fits == 0:
            print "    disasters:    IGNORED"
        else:
            tf = mttf(site.fits)
            print("    disaster rate: %12s (%d FITS)" %
                  (fmt.printTime(tf), site.fits))
        if site.replace == 0:
            print "    site recovery:   NEVER"
        else:
            print "    site recovery: %11s" % fmt.printTime(site.replace)

        if multi is not None:
            print("    recovery rate: %8s/s (%s/PG)" %
                  (fmt.printSize(multi.speed),
                   fmt.printTime(multi.rados.rebuild_time(multi.speed))))
            if multi.latency == 0:
                print "    replication:       synchronous"
            else:
                print("    replication:       asynchronous (%s delay)" %
                      (fmt.printTime(multi.latency)))
Exemplo n.º 2
0
    def availability(self):
        """ fraction of the time during which a remote copy is available """
        # if we are ignoring failures, availability is 100%
        if self.fits == 0:
            return 1.0

        # if there is no repair, annual probability of non-failure
        if self.replace == 0:
            return Pfail(self.fits, YEAR, n=0)

        # one minus the time between failures and repair
        ttf = mttf(self.fits)
        return float(ttf) / (ttf + self.replace)
Exemplo n.º 3
0
    def availability(self):
        """ fraction of the time during which a remote copy is available """
        # if we are ignoring failures, availability is 100%
        if self.fits == 0:
            return 1.0

        # if there is no repair, annual probability of non-failure
        if self.replace == 0:
            return Pfail(self.fits, YEAR, n=0)

        # one minus the time between failures and repair
        ttf = mttf(self.fits)
        return float(ttf) / (ttf + self.replace)
Exemplo n.º 4
0
def Run(tests, period=YEAR, verbosity="all"):
    """ run and report a set of specified simulations
        tests -- actual list of simulations to run
                (print a header line for each None test)
        period -- simulation period
        verbosity -- output options
    """

    # figure out what output he wants
    headings = True
    parms = True
    descr = True
    if verbosity == "parameters":
        descr = False
    elif verbosity == "headings":
        parms = False
        descr = False
    elif verbosity == "data only":
        parms = False
        descr = False
        headings = False

    # introspect the tests to find the disk/raid/rados parameters
    disk = None
    raid = None
    rados = None
    site = None
    multi = None
    for t in tests:
        c = t.__class__.__name__
        if disk is None and "Disk" in c:
            disk = t
        if raid is None and c.startswith("RAID"):
            raid = t
        if rados is None and c.startswith("RADOS"):
            rados = t
        if site is None and c.startswith("Site"):
            site = t
        if multi is None and c.startswith("MultiSite"):
            multi = t

    # find elements that only exist beneath others
    if site is None and multi is not None:
        site = multi.site
    if rados is None and multi is not None:
        rados = multi.rados
    if disk is None and rados is not None:
        disk = rados.disk
    if disk is None and raid is not None:
        disk = raid.disk

    if parms and disk is not None:
        print("Disk Modeling Parameters")
        print("    size:     %10s" % printSize(disk.size))
        print("    FIT rate: %10d (MTBF = %s)" %
              (disk.fits, printTime(mttf(disk.fits))))
        print("    NRE rate: %10.1E" % (disk.nre))

    if parms and raid is not None:
        print("RAID parameters")
        print("    replace:  %16s" % (printTime(raid.delay)))
        if raid.speed > 0:
            print("    recovery rate: %7s/s (%s)" %
                        (printSize(raid.speed),
                         printTime(raid.rebuild_time())))
        print("    NRE model:        %10s" % (raid.nre_model))
        print("    object size:      %10s" % (printSize(raid.objsize)))

    if parms and rados is not None:
        print("RADOS parameters")
        print("    auto mark-out: %14s" % printTime(rados.delay))
        print("    recovery rate: %8s/s (%s/drive)" %
                    (printSize(rados.speed),
                     printTime(rados.rebuild_time(rados.speed))))
        print("    osd fullness: %7d%%" % (rados.full * 100))
        print("    declustering: %7d PG/OSD" % (rados.pgs))
        print("    NRE model:        %10s" % (rados.nre_model))
        print("    object size:  %7s" % printSize(rados.objsize, unit=1024))
        print("    stripe length:%7d" % (rados.stripe))

    if parms and site is not None:
        print("Site parameters")
        s = 0 if multi is None else multi.sites
        if site.fits == 0:
            print("    disasters:    IGNORED")
        else:
            tf = mttf(site.fits)
            print("    disaster rate: %12s (%d FITS)" %
                (printTime(tf), site.fits))
        if site.replace == 0:
            print("    site recovery:   NEVER")
        else:
            print("    site recovery: %11s" %
                    (printTime(site.replace)))

        if multi is not None:
            print("    recovery rate: %8s/s (%s/PG)" %
                (printSize(multi.speed),
                 printTime(multi.rados.rebuild_time(multi.speed))))
            if multi.latency == 0:
                print("    replication:       synchronous")
            else:
                print("    replication:       asynchronous (%s delay)" %
                            (printTime(multi.latency)))

    # column headings
    heads = ("storage", "durability",
            "PL(site)", "PL(copies)", "PL(NRE)", "PL(rep)", "loss/PiB")
    format = getFormat(heads)

    # column descriptions
    legends = [
        "storage unit/configuration being modeled",
        "probability of object survival",
        "probability of loss due to site failures",
        "probability of loss due to drive failures",
        "probability of loss due to NREs during recovery",
        "probability of loss due to replication failure",
        "expected data loss per Petabyte"
    ]

    if descr:
        print("")
        print("Column legends")
        s = printTime(period)
        i = 1
        while i <= len(legends):
            l = legends[i - 1]
            if i == 1:
                print("\t%d %s" % (i, l))
            else:
                print("\t%d %s (per %s)" % (i, l, s))
            i += 1

    if headings:
        printHeadings(heads, format)

    # expected data loss after drive failures
    for t in tests:
        if t is None:
            printHeadings(heads, format)
            continue

        # calculate the renderable reliabilities and durability
        s = list()
        t.compute(period=period)
        s.append(t.description)                 # description
        s.append(printDurability(t.dur))        # durability
        s.append(printProbability(t.P_site))    # P(site failure)
        s.append(printProbability(t.P_drive))   # P(drive failure)
        s.append(printProbability(t.P_nre))     # P(NRE on recovery)
        s.append(printProbability(t.P_rep))     # P(replication failure)
        l = (t.P_site * t.L_site) + (t.P_drive * t.L_drive) +\
            (t.P_nre * t.L_nre) + (t.P_rep * t.L_rep)
        s.append(printFloat(l * PiB / t.rawsize))   # expected data loss/PiB
        print(format % tuple(s))
Exemplo n.º 5
0
def Run(tests, period=YEAR, verbosity="all"):
    """ run and report a set of specified simulations
        tests -- actual list of simulations to run
                (print a header line for each None test)
        period -- simulation period
        verbosity -- output options
    """

    # figure out what output he wants
    headings = True
    parms = True
    descr = True
    if verbosity == "parameters":
        descr = False
    elif verbosity == "headings":
        parms = False
        descr = False
    elif verbosity == "data only":
        parms = False
        descr = False
        headings = False

    # introspect the tests to find the disk/raid/rados parameters
    disk = None
    raid = None
    rados = None
    site = None
    multi = None
    for t in tests:
        c = t.__class__.__name__
        if disk is None and "Disk" in c:
            disk = t
        if raid is None and c.startswith("RAID"):
            raid = t
        if rados is None and c.startswith("RADOS"):
            rados = t
        if site is None and c.startswith("Site"):
            site = t
        if multi is None and c.startswith("MultiSite"):
            multi = t

    # find elements that only exist beneath others
    if site is None and multi is not None:
        site = multi.site
    if rados is None and multi is not None:
        rados = multi.rados
    if disk is None and rados is not None:
        disk = rados.disk
    if disk is None and raid is not None:
        disk = raid.disk

    if parms and disk is not None:
        print("Disk Modeling Parameters")
        print("    size:     %10s" % printSize(disk.size))
        print("    FIT rate: %10d (MTBF = %s)" %
              (disk.fits, printTime(mttf(disk.fits))))
        print("    NRE rate: %10.1E" % (disk.nre))

    if parms and raid is not None:
        print("RAID parameters")
        print("    replace:  %16s" % (printTime(raid.delay)))
        if raid.speed > 0:
            print("    recovery rate: %7s/s (%s)" %
                  (printSize(raid.speed), printTime(raid.rebuild_time())))
        print("    NRE model:        %10s" % (raid.nre_model))
        print("    object size:      %10s" % (printSize(raid.objsize)))

    if parms and rados is not None:
        print("RADOS parameters")
        print("    auto mark-out: %14s" % printTime(rados.delay))
        print("    recovery rate: %8s/s (%s/drive)" % (printSize(
            rados.speed), printTime(rados.rebuild_time(rados.speed))))
        print("    osd fullness: %7d%%" % (rados.full * 100))
        print("    declustering: %7d PG/OSD" % (rados.pgs))
        print("    NRE model:        %10s" % (rados.nre_model))
        print("    object size:  %7s" % printSize(rados.objsize, unit=1024))
        print("    stripe length:%7d" % (rados.stripe))

    if parms and site is not None:
        print("Site parameters")
        s = 0 if multi is None else multi.sites
        if site.fits == 0:
            print("    disasters:    IGNORED")
        else:
            tf = mttf(site.fits)
            print("    disaster rate: %12s (%d FITS)" %
                  (printTime(tf), site.fits))
        if site.replace == 0:
            print("    site recovery:   NEVER")
        else:
            print("    site recovery: %11s" % (printTime(site.replace)))

        if multi is not None:
            print("    recovery rate: %8s/s (%s/PG)" %
                  (printSize(multi.speed),
                   printTime(multi.rados.rebuild_time(multi.speed))))
            if multi.latency == 0:
                print("    replication:       synchronous")
            else:
                print("    replication:       asynchronous (%s delay)" %
                      (printTime(multi.latency)))

    # column headings
    heads = ("storage", "durability", "PL(site)", "PL(copies)", "PL(NRE)",
             "PL(rep)", "loss/PiB")
    format = getFormat(heads)

    # column descriptions
    legends = [
        "storage unit/configuration being modeled",
        "probability of object survival",
        "probability of loss due to site failures",
        "probability of loss due to drive failures",
        "probability of loss due to NREs during recovery",
        "probability of loss due to replication failure",
        "expected data loss per Petabyte"
    ]

    if descr:
        print("")
        print("Column legends")
        s = printTime(period)
        i = 1
        while i <= len(legends):
            l = legends[i - 1]
            if i == 1:
                print("\t%d %s" % (i, l))
            else:
                print("\t%d %s (per %s)" % (i, l, s))
            i += 1

    if headings:
        printHeadings(heads, format)

    # expected data loss after drive failures
    for t in tests:
        if t is None:
            printHeadings(heads, format)
            continue

        # calculate the renderable reliabilities and durability
        s = list()
        t.compute(period=period)
        s.append(t.description)  # description
        s.append(printDurability(t.dur))  # durability
        s.append(printProbability(t.P_site))  # P(site failure)
        s.append(printProbability(t.P_drive))  # P(drive failure)
        s.append(printProbability(t.P_nre))  # P(NRE on recovery)
        s.append(printProbability(t.P_rep))  # P(replication failure)
        l = (t.P_site * t.L_site) + (t.P_drive * t.L_drive) +\
            (t.P_nre * t.L_nre) + (t.P_rep * t.L_rep)
        s.append(printFloat(l * PiB / t.rawsize))  # expected data loss/PiB
        print(format % tuple(s))