net.lightbody.bmp.core.har.Har.getLog()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中net.lightbody.bmp.core.har.Har.getLog()方法的一些代码示例,展示了Har.getLog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Har.getLog()方法的具体详情如下:
包路径:net.lightbody.bmp.core.har.Har
类名称:Har
方法名:getLog

Har.getLog介绍

暂无

代码示例

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

public PageRefFilteredHar(Har har, String pageRef) {
    super(new PageRefFilteredHarLog(har.getLog(), pageRef));
  }
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

public PageRefFilteredHar(Har har, Set<String> pageRef) {
  super(new PageRefFilteredHarLog(har.getLog(), pageRef));
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

public void notifyHarChange(){
  if (previewAdapter != null) {
    harLog = ((MainActivity) getActivity()).getFiltedHar().getLog();
    harEntryList.clear();
    harEntryList.addAll(harLog.getEntries());
    previewAdapter.notifyDataSetChanged();
  }
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

public Set<String> getPageSet() {
  BrowserMobProxy proxy = ((SysApplication) getApplication()).proxy;
  Set<String> pageSet = new HashSet<>();
  for (HarPage harPage : proxy.getHar().getLog().getPages()) {
    if (!disablePages.contains(harPage.getId())) {
      pageSet.add(harPage.getId());
    }
  }
  return pageSet;
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public void proxyToServerConnectionFailed() {
  // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the
  // entire HarEntry and add it to this har.
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage());
  har.getLog().addEntry(harEntry);
  // record the amount of time we attempted to connect in the HarTimings object
  if (connectionStartedNanos > 0L) {
    harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS);
  }
  httpConnectTimes.remove(clientAddress);
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public void proxyToServerResolutionFailed(String hostAndPort) {
  // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the
  // entire HarEntry and add it to this har.
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort));
  har.getLog().addEntry(harEntry);
  // record the amount of time we attempted to resolve the hostname in the HarTimings object
  if (dnsResolutionStartedNanos > 0L) {
    harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS);
  }
  httpConnectTimes.remove(clientAddress);
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
  public void onClick(View view) {
    if(harLog.getEntries().indexOf(harEntry)>=0) {
      isHiddenHID = true;
      Intent intent = new Intent(getContext(), HarDetailActivity.class);
      intent.putExtra("pos", ((SysApplication) getActivity().getApplication()).proxy.
          getHar().getLog().getEntries().indexOf(harEntry));
      getActivity().startActivity(intent);
    }
  }
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
protected FilterResults performFiltering(CharSequence constraint) {
  harLog = ((MainActivity) getActivity()).getFiltedHar().getLog();

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
  // Inflate the layout for this fragment
  View view = inflater.inflate(R.layout.fragment_preview, container, false);
  ButterKnife.bind(this, view);
  if(SysApplication.isInitProxy) {
    harLog = ((SysApplication) getActivity().getApplication()).proxy.getHar().getLog();
    harEntryList.addAll(harLog.getEntries());
  }
  recyclerView.addItemDecoration(new RecycleViewDivider(getActivity(), RecycleViewDivider.VERTICAL_LIST));
  recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
  recyclerView.setAdapter(previewAdapter = new PreviewAdapter());
  if(((MainActivity) getActivity()).searchView!=null){
    ((MainActivity) getActivity()).searchView.setVisibility(View.VISIBLE);
  }
  return view;
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public Har newPage(String pageRef, String pageTitle) {
  if (har == null) {
    throw new IllegalStateException("No HAR exists for this proxy. Use newHar() to create a new HAR before calling newPage().");
  }
  Har endOfPageHar = null;
  if (currentHarPage != null) {
    String currentPageRef = currentHarPage.getId();
    // end the previous page, so that page-wide timings are populated
    endPage();
    // the interface requires newPage() to return the Har as it was immediately after the previous page was ended.
    endOfPageHar = BrowserMobProxyUtil.copyHarThroughPageRef(har, currentPageRef);
  }
  if (pageRef == null) {
    pageRef = "Page " + harPageCount.getAndIncrement();
  }
  if (pageTitle == null) {
    pageTitle = pageRef;
  }
  HarPage newPage = new HarPage(pageRef, pageTitle);
  har.getLog().addPage(newPage);
  currentHarPage = newPage;
  return endOfPageHar;
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

if (har.getLog() == null) {
  return new Har();
for (HarPage page : har.getLog().getPages()) {
  pageRefsToCopy.add(page.getId());
for (HarEntry entry : har.getLog().getEntries()) {
  if (pageRefsToCopy.contains(entry.getPageref())) {
    logCopy.addEntry(entry);
for (HarPage page : har.getLog().getPages()) {
  if (pageRefsToCopy.contains(page.getId())) {
    logCopy.addPage(page);

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

View view = inflater.inflate(R.layout.alert_filter, null);
ListView listView = (ListView) view.findViewById(R.id.list);
List<HarPage> harPageList = proxy.getHar().getLog().getPages();
final List<PageBean> pageBeenList = new ArrayList<>();
  pageBean.setCount(proxy.getHar(harPage.getId()).getLog().getEntries().size() + "");
  pageBeenList.add(pageBean);

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_json);
    ButterKnife.bind(this);
//
//        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//        setSupportActionBar(toolbar);

    setupActionBar();

    try {
      int pos = getIntent().getIntExtra("pos",-1);
      if(pos > -1){
        HarLog harLog = ((SysApplication) getApplication()).proxy.getHar().getLog();
        HarEntry harEntry = harLog.getEntries().get(pos);
        content = harEntry.getResponse().getContent().getText();
        initViewDelay(content);
      }else{
        finish();
      }
    } catch (Exception e) {
      e.printStackTrace();
      finish();
    }
  }

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public void serverToProxyResponseTimedOut() {
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResponseTimedOutErrorMessage());
  har.getLog().addEntry(harEntry);
  // include this timeout time in the HarTimings object
  long timeoutTimestampNanos = System.nanoTime();
  // if the proxy started to send the request but has not yet finished, we are currently "sending"
  if (sendStartedNanos > 0L && sendFinishedNanos == 0L) {
    harEntry.getTimings().setSend(timeoutTimestampNanos - sendStartedNanos, TimeUnit.NANOSECONDS);
  }
  // if the entire request was sent but the proxy has not begun receiving the response, we are currently "waiting"
  else if (sendFinishedNanos > 0L && responseReceiveStartedNanos == 0L) {
    harEntry.getTimings().setWait(timeoutTimestampNanos - sendFinishedNanos, TimeUnit.NANOSECONDS);
  }
  // if the proxy has already begun to receive the response, we are currenting "receiving"
  else if (responseReceiveStartedNanos > 0L) {
    harEntry.getTimings().setReceive(timeoutTimestampNanos - responseReceiveStartedNanos, TimeUnit.NANOSECONDS);
  }
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

har.getLog().addEntry(harEntry);

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

public void initHarLog(int pos) {
  HarLog harLog = ((SysApplication) getApplication()).proxy.getHar().getLog();
  HarEntry harEntry = harLog.getEntries().get(pos);

代码示例来源:origin: com.infotel.seleniumRobot/core

public HarCapture(Har har) throws IOException {
  super(har.getLog().getPages().get(0).getTitle(), false, new ArrayList<>());
  harFile = har;
  File harFile = Paths.get(SeleniumTestsContextManager.getThreadContext().getOutputDirectory(), HAR_FILE_NAME).toFile();
  
  har.writeTo(harFile);
  logger.info("HAR capture file copied to " + harFile.getAbsolutePath());
}

代码示例来源:origin: net.lightbody.bmp/browsermob-core

@Override
public void proxyToServerResolutionFailed(String hostAndPort) {
  // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the
  // entire HarEntry and add it to this har.
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort));
  har.getLog().addEntry(harEntry);
  // record the amount of time we attempted to resolve the hostname in the HarTimings object
  if (dnsResolutionStartedNanos > 0L) {
    harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS);
  }
  httpConnectTimes.remove(clientAddress);
}

代码示例来源:origin: misakuo/Dream-Catcher

@Override
public void proxyToServerResolutionFailed(String hostAndPort) {
  // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the
  // entire HarEntry and add it to this har.
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort));
  har.getLog().addEntry(harEntry);
  // record the amount of time we attempted to resolve the hostname in the HarTimings object
  if (dnsResolutionStartedNanos > 0L) {
    harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS);
  }
  httpConnectTimes.remove(clientAddress);
}

代码示例来源:origin: net.lightbody.bmp/browsermob-core

@Override
public void proxyToServerConnectionFailed() {
  // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the
  // entire HarEntry and add it to this har.
  HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage());
  har.getLog().addEntry(harEntry);
  // record the amount of time we attempted to connect in the HarTimings object
  if (connectionStartedNanos > 0L) {
    harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS);
  }
  httpConnectTimes.remove(clientAddress);
}

相关文章