Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(44)  |  Call(20)  |  Derive(0)  |  Import(24)
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

        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))
        


src/c/e/ceph-tools-HEAD/models/reliability/main.py   ceph-tools(Download)
from MultiRely import MultiSite
from Config import Config
from Run import Run
 
 
 
    if which == "disk":
        Run([disk], period=cfg.period, verbosity=cfg.verbose)
        return
 
                                  delay=cfg.raid_replace,
                                  objsize=cfg.obj_size)
        Run([raid], period=cfg.period, verbosity=cfg.verbose)
        return
 
                    delay=cfg.rados_markout)
    if which == "rados":
        Run([rados], period=cfg.period, verbosity=cfg.verbose)
        return
 
                latency=cfg.remote_latency,
                sites=cfg.remote_sites)
        Run([multi], period=cfg.period, verbosity=cfg.verbose)
        return
 

src/p/a/Pails-HEAD/core/commands/__init__.py   Pails(Download)
from Run import Run
from Routes import Routes
 
__all__ = ['Run', 'Routes']