Dump page statistics like db_dump.
766619
def dump
      out  = ""
      out << "Page #{current}\n"
      out << "  type:            #{MiqBdbPage.type2string(ptype)}\n"
      out << "  prev:            #{prev}\n"
      out << "  next:            #{@header['next_pgno']}\n"
      out << "  log seq num:     file=#{@header['lsn_file']}  offset=#{@header['lsn_offset']}\n"
      out << "  level:           #{level}\n"

      if @header['p_type'] == P_OVERFLOW
        out << "  ref cnt:         #{nentries}\n"
        out << "  len:             #{offset}\n"
      else
        out << "  entries:         #{nentries}\n"
        out << "  offset:          #{offset}\n"
      end
      out << "  data size:       #{@data.size}\n"
      out << "  data:            "

      @data.bytes.take(20).each do |c|
        out << sprintf("%.2x ", c)
      end
      out << "..." if @data.size > 20

      out << "\n\n"
      out
    end
21319
def dump_stats(self, pattern):
        
        if not isinstance(pattern, basestring):
            raise TypeError("pattern can only be an instance of type basestring")
        self._call("dumpStats",
                     in_p=[pattern])
404544
def dump(self):
        """"""
        assert self.database is not None

        cmd = "SELECT count from {} WHERE rowid={}"
        self._execute(cmd.format(self.STATE_INFO_TABLE, self.STATE_INFO_ROW))
        ret = self._fetchall()
        assert len(ret) == 1
        assert len(ret[0]) == 1
        count = self._from_sqlite(ret[0][0]) + self.inserts

        if count > self.row_limit:
            msg = "cleaning up state, this might take a while."
            logger.warning(msg)

            delete = count - self.row_limit
            delete += int(self.row_limit * (self.row_cleanup_quota / 100.0))
            cmd = (
                "DELETE FROM {} WHERE timestamp IN ("
                "SELECT timestamp FROM {} ORDER BY timestamp ASC LIMIT {});"
            )
            self._execute(
                cmd.format(self.STATE_TABLE, self.STATE_TABLE, delete)
            )

            self._vacuum()

            cmd = "SELECT COUNT(*) FROM {}"

            self._execute(cmd.format(self.STATE_TABLE))
            ret = self._fetchall()
            assert len(ret) == 1
            assert len(ret[0]) == 1
            count = ret[0][0]

        cmd = "UPDATE {} SET count = {} WHERE rowid = {}"
        self._execute(
            cmd.format(
                self.STATE_INFO_TABLE,
                self._to_sqlite(count),
                self.STATE_INFO_ROW,
            )
        )

        self._update_cache_directory_state()

        self.database.commit()
        self.cursor.close()
        self.database.close()
        self.database = None
        self.cursor = None
        self.inserts = 0
660447
def dump_stats(filename):
    # type: (str) -> None
    
    res = _dump_impl()
    f = open(filename, 'w')
    json.dump(res, f, indent=4)
    f.close()
634160
protected function dumpDatabases()
    {

        foreach ($this->db->query("SHOW DATABASES") as $list) {
            $database = $list->Database;

            if (!in_array($database, $this->ignore) || preg_match("~_no_backup$~", $database)) {
                $start = microtime(true);

                $dir = $this->dump_dir . '1/';

                $filename = $dir . $database;

                $this->log("Dumping Database: " . $database);
                $command = "mysqldump -u " . $this->db_user . " -h "
                    . $this->db_host . " -p" . $this->db_pass . " "
                    . $database . ">" . $filename . ".sql";

                exec($command);

                $command = "tar -zcvf " . $filename . ".gz " . $filename . ".sql";
                exec($command);
                $ms = round((microtime(true) - $start) * 1000, 2);

                clearstatcache();
                $size = round((filesize($filename . '.gz') / 1024), 2) . 'kb';

                $this->log($list->Database . " was backed up in " . $ms . ' ms and is ' . $size . ' bytes');
                unlink($filename . '.sql');
            }
        }
    }
56699
def _dump_crawl_stats(self):
        '''
        
        '''
        extras = {}
        spiders = {}

        spider_set = set()
        total_spider_count = 0

        keys = self.redis_conn.keys('stats:crawler:*:*:*')
        for key in keys:
            # we only care about the spider
            elements = key.split(":")
            spider = elements[3]

            if spider not in spiders:
                spiders[spider] = 0

            if len(elements) == 6:
                # got a time based stat
                response = elements[4]
                end = elements[5]

                final = '{s}_{r}_{e}'.format(s=spider, r=response, e=end)

                if end == 'lifetime':
                    value = self.redis_conn.execute_command("PFCOUNT", key)
                else:
                    value = self.redis_conn.zcard(key)

                extras[final] = value

            elif len(elements) == 5:
                # got a spider identifier
                spiders[spider] += 1
                total_spider_count += 1
                spider_set.add(spider)

            else:
                self.logger.warn("Unknown crawler stat key", {"key":key})

        # simple counts
        extras['unique_spider_count'] = len(spider_set)
        extras['total_spider_count'] = total_spider_count

        for spider in spiders:
            extras['{k}_spider_count'.format(k=spider)] = spiders[spider]

        if not self.logger.json:
            self.logger.info('Crawler Stats Dump:\n{0}'.format(
                    json.dumps(extras, indent=4, sort_keys=True)))
        else:
            self.logger.info('Crawler Stats Dump', extra=extras)
1167244
def dump(self):
        """"""
        for key in self._store.keys():
            print(key, ':', self.get(key))
609398
def dumplist(args):
  """"""

  from .query import Database
  db = Database()

  r = db.objects(
      protocol=args.protocol,
      purposes=args.purpose,
      model_ids=(args.client,),
      groups=args.group,
      classes=args.sclass
  )

  output = sys.stdout
  if args.selftest:
    from bob.db.utils import null
    output = null()

  for f in r:
    output.write('%s\n' % (f.make_path(args.directory, args.extension),))

  return 0
905768
def dump_json_data(self, get_children=False):
        
        def content_langs_ordered():
            """
            Return a list of languages ordered by the page content
            with the latest creation date in each.  This will be used
            to maintain the state of the language_up_to_date template
            tag when a page is restored or imported into another site.
            """
            params = {'page': self}
            if self.freeze_date:
                params['creation_date__lte'] = self.freeze_date
            cqs = Content.objects.filter(**params)
            cqs = cqs.values('language').annotate(latest=Max('creation_date'))
            return [c['language'] for c in cqs.order_by('latest')]
        languages = content_langs_ordered()

        def language_content(ctype):
            return dict(
                (lang, self.get_content(lang, ctype, language_fallback=False))
                for lang in languages)

        def placeholder_content():
            """Return content of each placeholder in each language."""
            out = {}
            for p in get_placeholders(self.get_template()):
                if p.name in ('title', 'slug'):
                    continue  # these were already included
                out[p.name] = language_content(p.name)

            for p in Content.objects.filter(type__in=['meta_title', 'meta_description', 'meta_keywords', 'meta_author', 'fb_page_type', 'fb_image']):
                out[p.type] = language_content(p.type)
            return out

        def isoformat(d):
            return None if d is None else d.strftime(ISODATE_FORMAT)

        def custom_email(user):
            """Allow a user's profile to return an email for the user."""
            try:
                profile = user.get_profile()
            except (ObjectDoesNotExist, AttributeError):
                return user.email
            get_email = getattr(profile, 'get_email', None)
            return get_email() if get_email else user.email

        tags = [tag.name for tag in self.tags.all()]

        children = []
        if get_children:
            for c in self.children.filter(status__in=[self.PUBLISHED, self.HIDDEN]):
                children.append(c.dump_json_data())

        return {
            'complete_slug': dict(
                (lang, self.get_complete_slug(lang, hideroot=False))
                for lang in languages),
            'title': language_content('title'),
            'author_email': custom_email(self.author),
            'creation_date': isoformat(self.creation_date),
            'publication_date': isoformat(self.publication_date),
            'publication_end_date': isoformat(self.publication_end_date),
            'last_modification_date': isoformat(self.last_modification_date),
            'status': {
                Page.PUBLISHED: 'published',
                Page.HIDDEN: 'hidden',
                Page.DRAFT: 'draft'}[self.status],
            'template': self.template,
            'sites': (
                [site.domain for site in self.sites.all()]
                if settings.PAGE_USE_SITE_ID else []),
            'redirect_to_url': self.redirect_to_url,
            'redirect_to_complete_slug': dict(
                (lang, self.redirect_to.get_complete_slug(
                    lang, hideroot=False))
                for lang in self.redirect_to.get_languages()
                ) if self.redirect_to is not None else None,
            'content': placeholder_content(),
            'content_language_updated_order': languages,
            'tags': tags,
            'children': children
        }
360057
function dump() {
		$fw=Base::instance();
		$web=Web::instance();
		$out='';
		return ($req=$web->request(
			self::URL_Static.'?'.array_reduce(
				$this->query,
				function($out,$item) {
					return ($out.=($out?'&':'').
						urlencode($item[0]).'='.urlencode($item[1]));
				}
			))) && $req['body']?$req['body']:FALSE;
	}
1066709
public void dump_stats(Writer out, boolean labels)
    throws IOException
    {
        if ( labels ) {
            out.write("--------------------------------------------------\n");
            out.write("FileManager Header:\n");
            out.write("--------------------------------------------------\n");
            out.write("Filename = " + filename + "\n");
            out.write("Allocations: " + allocs + "\n");
            out.write("Deallocations: " + deallocs +"\n");
            out.write("Coalesces: " + coalesces + "\n");
            out.write("Allocated blocks: " + allocated_blocks + "\n");
            out.write("Allocated bytes: " + allocated_words +"\n");           
            out.write("Free blocks: " + free_blocks+ "\n");
            out.write("Free bytes: " + free_words+ "\n");
            out.write("Seeks: " + seeks+ "\n");
            out.write("Requests for small blocks: " + small_requests+ "\n");
            out.write("Requests for large blocks: " + large_requests+ "\n");
            out.write("Quick list hits: " + ql_hits+ "\n");
            out.write("Misc list hits: " + ml_hits+ "\n");
            out.write("Block splits (from misc list): " + ml_splits+ "\n");
            out.write("Misc list blocks searched: " + ml_blocks_searched+ "\n");
            out.write("Fast startups: " + fast_startups+ "\n");

            //out.write("Internal blocksize = " + CACHE_PAGESIZE + "\n");
            //out.write("Cache size = " + cachesize+ "\n");
            //out.write("Cache hits: " + cache_hits+ "\n");
            //out.write("Cache misses: " + cache_misses+ "\n");
            //out.write("Page allocations: " + page_allocations+ "\n");
            out.write("Read requests: " + read_count + "\n");
            out.write("Write requests: " + write_count+ "\n");
            out.write("Accumulated physical read time:" + read_time+ "\n");
            out.write("Accumulated physical write time:" + write_time+ "\n");
            out.write("Bytes read: " + bytes_read + "\n");
            out.write("Bytes written: " + bytes_written + "\n");
        } else {
            out.write(filename + "\t");
            out.write(allocs + "\t");
            out.write(deallocs +"\t");
            out.write(coalesces + "\t");
            out.write(allocated_blocks + "\t");
            out.write(allocated_words +"\t");           
            out.write(free_blocks+ "\t");
            out.write(free_words+ "\t");

            out.write(seeks+ "\t");
            out.write(read_count + "\t");
            out.write(write_count+ "\t");
            out.write(read_time+ "\t");
            out.write(write_time+ "\t");

            out.write(bytes_read + "\t");
            out.write(bytes_written + "\t");

            out.write(small_requests+ "\t");
            out.write(large_requests+ "\t");
            out.write(ql_hits+ "\t");
            out.write(ml_hits+ "\t");
            out.write(ml_splits+ "\t");
            out.write(ml_blocks_searched+ "\t");
            out.write(fast_startups+ "\t");

            //out.write(CACHE_PAGESIZE + "\t");
            //out.write(cachesize+ "\t");
            //out.write(cache_hits+ "\t");
            //out.write(cache_misses+ "\t");
            //out.write(page_allocations+ "\t");

        }
    }
1093556
def dump_database_object(obj: T, fieldlist: Iterable[str]) -> None:
    """"""
    log.info(_LINE_EQUALS)
    log.info("DUMP OF: {}", obj)
    for f in fieldlist:
        log.info(u"{f}: {v}", f=f, v=getattr(obj, f))
    log.info(_LINE_EQUALS)
412827
def dump(cls):
        """"""
        with cls.lock:
            if not cls.instances: return
            atexit.unregister(cls.dump)

            cls._pre_dump()

            for self in cls.instances.values():
                self._dump()

            cls._post_dump()
639927
def handle_dump(self, params):
        
        print("Clients:", self.server.clients)
        for client in self.server.clients.values():
            print(" ", client)
            for channel in client.channels.values():
                print("     ", channel.name)
        print("Channels:", self.server.channels)
        for channel in self.server.channels.values():
            print(" ", channel.name, channel)
            for client in channel.clients:
                print("     ", client.nick, client)
936671
def dumps(self):
        """"""

        ret_str = []
        ret_str.append(Command('node', options=self.options).dumps())

        if self.handle is not None:
            ret_str.append('({})'.format(self.handle))

        if self._node_position is not None:
            ret_str.append('at {}'.format(str(self._position)))

        if self._node_text is not None:
            ret_str.append('{{{text}}};'.format(text=self._node_text))
        else:
            ret_str.append('{};')

        return ' '.join(ret_str)
718903
def pg_dump(db_name, backup_path):
    """"""

    logger.info("Dumping %s to %s", repr(db_name), repr(backup_path))
    return shell(
        'pg_dump "{db_name}" -U "{USER}" -h "{HOST}" '
        "--schema=public --file={backup_path}".format(
            db_name=db_name, backup_path=backup_path, **DB
        )
    )
111963
def dump_stats(myStats):
    
    print("\n----%s PYTHON PING Statistics----" % (myStats.thisIP))

    if myStats.pktsSent > 0:
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd) \
                / myStats.pktsSent

    print(("%d packets transmitted, %d packets received, "
           "%0.1f%% packet loss") % (
        myStats.pktsSent,
        myStats.pktsRcvd,
        100.0 * myStats.fracLoss
    ))

    if myStats.pktsRcvd > 0:
        print("round-trip (ms)  min/avg/max = %d/%0.1f/%d" % (
            myStats.minTime,
            myStats.totTime / myStats.pktsRcvd,
            myStats.maxTime
        ))

    print("")
    return