poa-netstats-agent/doc/POAAgent.Plugins.Transfers....

291 lines
10 KiB
HTML
Raw Permalink Normal View History

2018-07-06 13:59:27 -07:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>POAAgent.Plugins.Transfers.WebSocket.Primus poa_agent v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
2018-08-22 10:49:21 -07:00
<script src="dist/sidebar_items-75149ca71e.js"></script>
2018-07-06 13:59:27 -07:00
</head>
<body data-type="modules">
<script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" aria-hidden="true"></span>
<span class="sr-only">Toggle Sidebar</span>
</button>
<button class="sidebar-button night-mode-toggle">
<span class="icon-theme" aria-hidden="true"></span>
<span class="sr-only">Toggle Theme</span>
</button>
<section class="sidebar">
2018-08-20 17:35:56 -07:00
<a href="POAAgent.html" class="sidebar-projectLink">
2018-07-06 13:59:27 -07:00
<div class="sidebar-projectDetails">
<h1 class="sidebar-projectName">
poa_agent
</h1>
<h2 class="sidebar-projectVersion">
v0.1.0
</h2>
</div>
</a>
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
</button>
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search" aria-label="Search" autocomplete="off" />
</form>
<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>
<li><a id="modules-list" href="#full-list">Modules</a></li>
</ul>
<div class="gradient"></div>
<ul id="full-list" class="sidebar-fullList"></ul>
</section>
<section class="content">
<div class="content-outer">
<div id="content" class="content-inner">
<h1>
<small class="visible-xs">poa_agent v0.1.0</small>
POAAgent.Plugins.Transfers.WebSocket.Primus
<a href="https://github.com/poanetwork/poa-netstats-agent/blob/v0.1.0/lib/poa_agent/plugins/transfers/web_socket/primus.ex#L1" title="View Source" class="view-source" rel="help">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</h1>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Summary
</h1>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
2018-08-22 10:49:21 -07:00
<a href="#data_received/4">data_received(label, metric_type, data, state)</a>
2018-07-06 13:59:27 -07:00
</div>
<div class="summary-synopsis"><p>In this callback is called when a Collector sends data to this Transfer</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#handle_message/2">handle_message(arg1, state)</a>
</div>
<div class="summary-synopsis"><p>In this callback is called when the Transfer process receives an erlang message</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#init_transfer/1">init_transfer(configuration)</a>
</div>
<div class="summary-synopsis"><p>A callback executed when the Transfer Plugin starts.
The argument is retrieved from the configuration file when the Transfer is defined
It must return <code class="inline">{:ok, state}</code>, that <code class="inline">state</code> will be keept as in <a href="https://hexdocs.pm/elixir/GenServer.html"><code class="inline">GenServer</code></a> and can be
retrieved in the <code class="inline">data_received/2</code> function</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#terminate/1">terminate(_)</a>
</div>
<div class="summary-synopsis"><p>This callback is called just before the Process goes down. This is a good place for closing connections</p>
</div>
</div>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Functions
</h1>
2018-08-22 10:49:21 -07:00
<div class="detail" id="data_received/4">
2018-07-06 13:59:27 -07:00
<div class="detail-header">
2018-08-22 10:49:21 -07:00
<a href="#data_received/4" class="detail-link" title="Link to this function">
2018-07-06 13:59:27 -07:00
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
2018-08-22 10:49:21 -07:00
<span class="signature">data_received(label, metric_type, data, state)</span>
2018-07-06 13:59:27 -07:00
<a href="https://github.com/poanetwork/poa-netstats-agent/blob/v0.1.0/lib/poa_agent/plugins/transfers/web_socket/primus.ex#L82" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p> In this callback is called when a Collector sends data to this Transfer.</p>
2018-08-22 10:49:21 -07:00
<p> Regarding the parameters, <code class="inline">label</code> identifies the Collector, <code class="inline">metric_type</code> is the metric type in String format, it is used in order
to know which kind of data we are sending, the <code class="inline">data</code> is the real data received, and the <code class="inline">state</code> is the Collectors state</p>
2018-07-06 13:59:27 -07:00
<p> It must return <code class="inline">{:ok, state}</code>.</p>
2018-08-22 10:49:21 -07:00
<p>Callback implementation for <a href="POAAgent.Plugins.Transfer.html#c:data_received/4"><code class="inline">POAAgent.Plugins.Transfer.data_received/4</code></a>.</p>
2018-07-06 13:59:27 -07:00
</section>
</div>
<div class="detail" id="handle_message/2">
<div class="detail-header">
<a href="#handle_message/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">handle_message(arg1, state)</span>
<a href="https://github.com/poanetwork/poa-netstats-agent/blob/v0.1.0/lib/poa_agent/plugins/transfers/web_socket/primus.ex#L123" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p> In this callback is called when the Transfer process receives an erlang message.</p>
<p> It must return <code class="inline">{:ok, state}</code>.</p>
<p>Callback implementation for <a href="POAAgent.Plugins.Transfer.html#c:handle_message/2"><code class="inline">POAAgent.Plugins.Transfer.handle_message/2</code></a>.</p>
</section>
</div>
<div class="detail" id="init_transfer/1">
<div class="detail-header">
<a href="#init_transfer/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">init_transfer(configuration)</span>
<a href="https://github.com/poanetwork/poa-netstats-agent/blob/v0.1.0/lib/poa_agent/plugins/transfers/web_socket/primus.ex#L39" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p> A callback executed when the Transfer Plugin starts.
The argument is retrieved from the configuration file when the Transfer is defined
It must return <code class="inline">{:ok, state}</code>, that <code class="inline">state</code> will be keept as in <a href="https://hexdocs.pm/elixir/GenServer.html"><code class="inline">GenServer</code></a> and can be
retrieved in the <code class="inline">data_received/2</code> function.</p>
<p>Callback implementation for <a href="POAAgent.Plugins.Transfer.html#c:init_transfer/1"><code class="inline">POAAgent.Plugins.Transfer.init_transfer/1</code></a>.</p>
</section>
</div>
<div class="detail" id="terminate/1">
<div class="detail-header">
<a href="#terminate/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">terminate(_)</span>
<a href="https://github.com/poanetwork/poa-netstats-agent/blob/v0.1.0/lib/poa_agent/plugins/transfers/web_socket/primus.ex#L137" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p> This callback is called just before the Process goes down. This is a good place for closing connections.</p>
<p>Callback implementation for <a href="POAAgent.Plugins.Transfer.html#c:terminate/1"><code class="inline">POAAgent.Plugins.Transfer.terminate/1</code></a>.</p>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.18.3),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
</footer>
</div>
</div>
</section>
</div>
<script src="dist/app-9bd040e5e5.js"></script>
</body>
</html>