예제 #1
0
  virtual void do_update_ui() {
    const unsigned c_width = 60;

    percent_done = calc_percent(extract_completed, extract_total);

    unsigned __int64 extract_speed;
    if (time_elapsed() == 0)
      extract_speed = 0;
    else
      extract_speed = al_round(static_cast<double>(extract_completed) / time_elapsed() * ticks_per_sec());

    if (extract_total && cache_total > extract_total)
      cache_total = extract_total;

    unsigned cache_stored_percent = calc_percent(cache_stored, cache_total);
    unsigned cache_written_percent = calc_percent(cache_written, cache_total);

    wostringstream st;
    st << fit_str(arc_path, c_width) << L'\n';
    st << L"\x1\n";
    st << fit_str(extract_file_path, c_width) << L'\n';
    st << setw(7) << format_data_size(extract_completed, get_size_suffixes()) << L" / " << format_data_size(extract_total, get_size_suffixes()) << L" @ " << setw(9) << format_data_size(extract_speed, get_speed_suffixes()) << L'\n';
    st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n';
    st << L"\x1\n";
    st << fit_str(cache_file_path, c_width) << L'\n';
    st << L"(" << format_data_size(cache_stored, get_size_suffixes()) << L" - " << format_data_size(cache_written, get_size_suffixes()) << L") / " << format_data_size(cache_total, get_size_suffixes()) << L'\n';
    st << get_progress_bar_str(c_width, cache_written_percent, cache_stored_percent) << L'\n';
    progress_text = st.str();
  }
예제 #2
0
void iiCoreTimeReport()
{
	g_printf("\n******************* Core Time Report ********************\n");

	if(g_slist_length(coreTimeList) > 0) {
		// sort events by global occurence
		coreTimeList = g_slist_sort(coreTimeList, compare_coretime_events);
		GSList* iter = coreTimeList;
		gint lastprocid = 0;

		g_printf(" [P]   [#]                    [event]            [result]\n");

		for(;iter;iter=g_slist_next(iter)) {
			CoreTimeEvent* event = (CoreTimeEvent*) iter->data;

			if(event->proc != lastprocid) {
				g_printf("---------------------------------------------------------\n");
			}

			gchar* avg = format_coretime_throughput(event->avgCoreTime);
			gchar* min = format_coretime_throughput(event->minCoreTime);
			gchar* max = format_coretime_throughput(event->maxCoreTime);
			glong ioops = (event->numCalls>0? event->numCalls / event->avgCoreTime.time : 0);

			gchar* total = format_data_size(event->avgCoreTime.data);

			g_printf(" %2d   %3d   %25s   avg %12s\n", event->proc, event->id, event->name, avg);
			g_printf(" %36s   min %12s\n", "", min);
			g_printf(" %36s   max %12s\n", "", max);
			g_printf("\n");
			g_printf(" %36s   avg %11.6f s\n", "", (event->numCalls? event->avgCoreTime.time / event->numCalls : 0));
			g_printf(" %36s   min %11.6f s\n", "", (event->minCallTime<G_MAXDOUBLE? event->minCallTime : 0));
			g_printf(" %36s   max %11.6f s\n", "", (event->maxCallTime>G_MINDOUBLE? event->maxCallTime : 0));
			g_printf("\n");
			g_printf(" %36s  %10ld IOops/s\n", "", ioops);
			g_printf("\n");
			g_printf(" %24s Total: %10s / %.6f s\n", "", total, event->avgCoreTime.time);
			g_printf("\n");

			lastprocid = event->proc;
			g_free(avg);
			g_free(min);
			g_free(max);
		}

		g_printf("[results]\n");
		g_printf("- Core time I/O throughput (average, min, max)\n");
		g_printf("- Calltime (average, min, max) for all statements\n  during this CoreTime Event\n");
		g_printf("- Total data processed per time in seconds\n  during this CoreTime event\n");
	}
	else {
		g_printf("No coretime events.\n");
	}
}
예제 #3
0
  virtual void do_update_ui() {
    const unsigned c_width = 60;

    if (total == 0)
      percent_done = 0;
    else
      percent_done = al_round(static_cast<double>(completed) * 100 / total);
    if (percent_done > 100)
      percent_done = 100;

    unsigned __int64 speed;
    if (time_elapsed() == 0)
      speed = 0;
    else
      speed = al_round(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());

    wostringstream st;
    st << setw(7) << format_data_size(completed, get_size_suffixes()) << L" / " << format_data_size(total, get_size_suffixes()) << L" @ " << setw(9) << format_data_size(speed, get_speed_suffixes()) << L'\n';
    st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n';
    progress_text = st.str();
  }
예제 #4
0
void WINAPI GetOpenPanelInfoW(OpenPanelInfo* info) {
  PluginInstance* plugin = (PluginInstance*) info->hPanel;

  info->StructSize = sizeof(OpenPanelInfo);

  info->Flags = OPIF_ADDDOTS | OPIF_SHORTCUT;
  info->CurDir = plugin->current_dir.data();
  info->Format = g_plugin_format.data();

  if (g_plugin_options.last_dev_type == dtPDA) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  else if (g_plugin_options.last_dev_type == dtSmartPhone) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_SMARTPHONE);
  else plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  plugin->panel_title.add(L":").add(plugin->current_dir);

  if (g_plugin_options.show_free_space) plugin->panel_title.add(L":" + format_data_size(plugin->free_space, get_size_suffixes()));
  info->PanelTitle = plugin->panel_title.data();
  info->InfoLines = plugin->sys_info.data();
  info->InfoLinesNumber = plugin->sys_info.size();
}
예제 #5
0
  virtual void do_update_ui() {
    const unsigned c_width = 60;

    percent_done = calc_percent(completed, total);

    unsigned __int64 time = time_elapsed();
    unsigned __int64 speed;
    if (time == 0)
      speed = 0;
    else
      speed = al_round(static_cast<double>(completed) / time * ticks_per_sec());

    unsigned __int64 total_time;
    if (completed)
      total_time = static_cast<unsigned __int64>(static_cast<double>(total) / completed * time);
    else
      total_time = 0;
    if (total_time < time)
      total_time = time;

    wostringstream st;
    st << fit_str(arc_path, c_width) << L'\n';
    st << L"\x1\n";
    st << fit_str(file_path, c_width) << L'\n';
    st << setw(7) << format_data_size(file_completed, get_size_suffixes()) << L" / " <<
      format_data_size(file_total, get_size_suffixes()) << L'\n';
    st << Far::get_progress_bar_str(c_width, calc_percent(file_completed, file_total), 100) << L'\n';
    st << L"\x1\n";
    st << setw(7) << format_data_size(completed, get_size_suffixes()) << L" / " <<
      format_data_size(total, get_size_suffixes()) << L" @ " << setw(9) <<
      format_data_size(speed, get_speed_suffixes()) << L" -" << format_time((total_time - time) / ticks_per_sec()) << L'\n';
    st << setw(7) << format_data_size(total_data_read, get_size_suffixes()) << L" \x2192 " <<
      setw(7) << format_data_size(total_data_written, get_size_suffixes()) << L" = " <<
      setw(2) << calc_percent(total_data_written, total_data_read) << L"%" << L'\n';
    st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n';
    progress_text = st.str();
  }