<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
	<channel>
		<title>Posts on </title>
		<link>https://zwrob.com/en/posts/</link>
		<description>Recent content in Posts on </description>
		<generator>Hugo -- 0.167.0</generator>
		<language>en</language>
		<lastBuildDate>Fri, 07 Feb 2025 20:44:29 -0800</lastBuildDate>
		<atom:link href="https://zwrob.com/en/posts/index.xml" rel="self" type="application/rss+xml" />
		
		
		<item>
			<title>Erlang</title>
			<link>https://zwrob.com/en/posts/erlang/</link>
			<pubDate>Fri, 07 Feb 2025 20:44:29 -0800</pubDate><guid>https://zwrob.com/en/posts/erlang/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<h1 id="erlang-resources">Erlang Resources<a href="#erlang-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="https://www.erlang.org/" target="_blank" >https://www.erlang.org/</a></li>
<li><a href="https://erlangforums.com/" target="_blank" >https://erlangforums.com/</a></li>
<li><a href="https://exercism.org/tracks/erlang" target="_blank" >https://exercism.org/tracks/erlang</a></li>
<li><a href="https://github.com/happi/theBeamBook" target="_blank" >https://github.com/happi/theBeamBook</a></li>
<li><a href="https://learnyousomeerlang.com/content" target="_blank" >https://learnyousomeerlang.com/content</a></li>
<li><a href="https://www.erlang.org/docs" target="_blank" >https://www.erlang.org/docs</a></li>
</ul>
<h1 id="gleam-resources">Gleam Resources<a href="#gleam-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="https://gleam.run/" target="_blank" >https://gleam.run/</a></li>
<li><a href="https://exercism.org/tracks/gleam" target="_blank" >https://exercism.org/tracks/gleam</a></li>
<li><a href="https://tour.gleam.run/everything/" target="_blank" >https://tour.gleam.run/everything/</a></li>
<li><a href="https://www.youtube.com/watch?v=WaHx6n2UZJg" target="_blank" >Getting to know Actors in Gleam - Raúl Chouza | Code BEAM America 2024</a></li>
<li><a href="https://www.youtube.com/playlist?list=PLvL2NEhYV4Zui6Gkr8Nniwyo4TnE17bF0" target="_blank" >code beam europe 2024</a></li>
<li><a href="https://www.youtube.com/watch?v=vPP8ib2qqtI" target="_blank" >An Erlanger&rsquo;s encounter with Gleam | Bartek Gorny</a></li>
</ul>
<h1 id="wisp-resources">Wisp Resources<a href="#wisp-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="https://www.youtube.com/watch?v=eVtkYQva0Ic" target="_blank" >End-to-end types: full-stack Web apps with Gleam by Hayleigh Thompson | Code BEAM Europe 2023</a></li>
<li><a href="https://www.youtube.com/watch?v=yHe_wzFg4W8" target="_blank" >A Code Centric Journey Into the Gleam Language • Giacomo Cavalieri • GOTO 2024</a></li>
<li><a href="https://www.youtube.com/watch?v=TbCm-zR7qZ0" target="_blank" >Lustre Universal Components: the best of Elm and Phoenix LiveView - H. Thompson | Lambda Days 2024</a></li>
</ul>
<h1 id="misc">Misc<a href="#misc" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="https://www.youtube.com/@CodeSync" target="_blank" >code sync</a></li>
<li><a href="https://www.youtube.com/watch?v=G7rhsWLrA_g&amp;list=PLvL2NEhYV4ZtPB-dh2s63eaUXPEFNOaxl" target="_blank" >code beam</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Pacific Crest Trail</title>
			<link>https://zwrob.com/en/posts/pct/</link>
			<pubDate>Tue, 14 Jan 2025 09:03:53 -0700</pubDate><guid>https://zwrob.com/en/posts/pct/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><img src="/assets/2024/cropped-tent.png" alt="tent"></p>
<h1 id="why">Why<a href="#why" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>Why are we doing this?</p>
<h2 id="todd">Todd<a href="#todd" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<pre tabindex="0"><code>I want to:
* re-connect with nature
* do this in a way that doesn&#39;t leave a huge carbon footprint
* figure out what I want to do with the next chapter in life 
  
Ever since I first smelled the Cascades, I&#39;ve wanted to spend time there. 
When I was in my teens, I heard about the PCT... I&#39;ve wanted to hike 
this for most of my life. 
</code></pre><p>[Kristin] TODO</p>
<pre tabindex="0"><code></code></pre><h2 id="details">Details<a href="#details" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="contact">Contact<a href="#contact" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>We&rsquo;ll both have our cell phones and will probably check them weekly or so. We&rsquo;ll also have a
Garmin In-Reach Mini so family and close friends can contact us in an emergency.</p>
<h3 id="plan">Plan<a href="#plan" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Hike from South to North (remember, never trust a southbounder). We&rsquo;ll start at the US/Mexico border and
see what happens.</p>
<h3 id="photos">Photos<a href="#photos" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>We&rsquo;ll post photos to <a href="https://photos.app.goo.gl/3PVYSZP4B2WC9K9JA" target="_blank" >this google photo album</a>.</p>
<h3 id="gear">Gear<a href="#gear" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><img src="/assets/2024/backpack/20240914_225724.jpg" alt="DIY backpack"></li>
<li><a href="../backpack" >DIY backpack post</a></li>
</ul>
<p>Something that was an easy hack that I&rsquo;m excited to use:</p>
<ul>
<li><img src="/assets/2025/usbc-female.jpg" alt="DIY USB-C adapter on a sonicare toothbrush 1"></li>
<li><a href="/assets/2025/battery-leads.jpg" >DIY USB-C adapter on a sonicare toothbrush 2</a></li>
<li><a href="/assets/2025/usbc-leads.jpg" >DIY USB-C adapter on a sonicare toothbrush 3</a></li>
</ul>
<h3 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="dehydrated-food">Dehydrated Food<a href="#dehydrated-food" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Here are some dehydrated food products that we&rsquo;ve researched. I think we&rsquo;ll be be eating
a fair bit of dried bean flakes. I&rsquo;ve tried a bunch of the various things we ordered from
3 of these companies. Overall, this stuff is all OK but not something I would choose over
fresh food.</p>
<ul>
<li><a href="https://docs.google.com/spreadsheets/d/10qb1tThJ6XUWW8XzCimc6SvcbRR-66hTpj7y3NToGmQ/edit?usp=sharing" target="_blank" >dehydrated food resources</a></li>
</ul>
<h4 id="protein">Protein<a href="#protein" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Some longtime friends have created these delicious snack sticks. I think these will be a
staple on this trip.</p>
<ul>
<li><a href="https://singingpastures.com/collections/meat-sticks" target="_blank" >singing pastures</a></li>
</ul>
<p>See you later!</p>
]]></content>
		</item>
		
		<item>
			<title>Prescribed Fire</title>
			<link>https://zwrob.com/en/posts/prescribed-fire/</link>
			<pubDate>Wed, 25 Sep 2024 06:04:12 -0700</pubDate><guid>https://zwrob.com/en/posts/prescribed-fire/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<h2 id="prescribed-burn-manager-certification-program">PRESCRIBED BURN MANAGER CERTIFICATION PROGRAM<a href="#prescribed-burn-manager-certification-program" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="history">History<a href="#history" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Prescribed Burn Manager Certification Program was established by <a href="https://lawfilesext.leg.wa.gov/biennium/2017-18/Pdf/Bills/House%20Passed%20Legislature/2733.PL.pdf?q=20240925062328" target="_blank" >House Bill 2733</a>, see also <a href="https://app.leg.wa.gov/rcw/default.aspx?cite=76.04.183" target="_blank" >Laws and Regs</a>.</p>
<p>What this law provides:</p>
<p><img src="/assets/2024/prescribed_fire/house-bill-2733.png" alt="Gross Negligence"></p>
<h3 id="dnr-program">DNR Program<a href="#dnr-program" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><a href="https://www.dnr.wa.gov/certifiedburner" target="_blank" >https://www.dnr.wa.gov/certifiedburner</a></li>
<li><a href="https://www.dnr.wa.gov/prescribedfire" target="_blank" >https://www.dnr.wa.gov/prescribedfire</a></li>
<li><a href="https://burnportal.dnr.wa.gov/" target="_blank" >https://burnportal.dnr.wa.gov/</a></li>
</ul>
<h4 id="pre-class-work">Pre Class Work<a href="#pre-class-work" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li><a href="/assets/2024/prescribed_fire/2024-pre-work.pdf" >Videos</a></li>
</ul>
<h4 id="class-work">Class Work<a href="#class-work" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>TODO: get slide decks from Kyle</li>
</ul>
<h4 id="field-work">Field Work<a href="#field-work" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p><img src="/assets/2024/prescribed_fire/field/20240919_081636.jpg" alt="20240919_081636.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_081638.jpg" alt="20240919_081638.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_081642.jpg" alt="20240919_081642.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082158.jpg" alt="20240919_082158.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082200.jpg" alt="20240919_082200.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082734.jpg" alt="20240919_082734.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082744.jpg" alt="20240919_082744.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082745.jpg" alt="20240919_082745.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082748.jpg" alt="20240919_082748.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_082805.jpg" alt="20240919_082805.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_084733.jpg" alt="20240919_084733.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_090326.jpg" alt="20240919_090326.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_090625.jpg" alt="20240919_090625.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_090632.jpg" alt="20240919_090632.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_091337.jpg" alt="20240919_091337.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_091345.jpg" alt="20240919_091345.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_091352.jpg" alt="20240919_091352.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095123.jpg" alt="20240919_095123.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095137.jpg" alt="20240919_095137.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095139.jpg" alt="20240919_095139.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095207.jpg" alt="20240919_095207.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095616.jpg" alt="20240919_095616.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095624.jpg" alt="20240919_095624.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_095628.jpg" alt="20240919_095628.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_110009.jpg" alt="20240919_110009.jpg">
<img src="/assets/2024/prescribed_fire/field/20240919_110019.jpg" alt="20240919_110019.jpg"></p>
<h3 id="process">Process<a href="#process" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>write a burn plan</li>
<li>request a burn permit (with burn plan attached)</li>
<li>attend weekly smoke meetings</li>
<li>request a smoke permit</li>
<li>with burn permit, burn plan, and smoke permit IN HAND, proceed with prescribed burn, but only according to plan</li>
</ul>
<h3 id="burn-plan">Burn Plan<a href="#burn-plan" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Also known as a Rx (Prescription)</p>
<ul>
<li>objectives</li>
<li>parameters</li>
<li>resources</li>
<li>impacts</li>
</ul>
<p><img src="/assets/2024/prescribed_fire/washington-certified-burner-broadcast-burn-plan.png" alt="20240919_110019.jpg"></p>
<h2 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://www.timothyeganbooks.com/the-big-burn" target="_blank" >The Big Burn</a></li>
<li><a href="https://www.srs.fs.usda.gov/pubs/su/su_srs054.pdf" target="_blank" >Introduction to Prescribed Fire in Southern Ecosystems</a></li>
<li><a href="https://extension.oregonstate.edu/catalog/pub/em-9387-prescribed-fire-basics-ignition-techniques-tools" target="_blank" >Ignition Techniques</a></li>
<li><a href="https://research.fs.usda.gov/treesearch/36328" target="_blank" >The Photoload Sampling Technique</a></li>
<li><a href="https://www.fs.usda.gov/rm/pubs_series/rmrs/gtr/rmrs_gtr153.pdf" target="_blank" >Standard Fire Behavior Fuel Models (Scott/Burgan)</a></li>
<li><a href="https://www.in.gov/dnr/fish-and-wildlife/files/HMFSPrescribedBurn.pdf" target="_blank" >Prescribed Burning</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>DIY Backpack</title>
			<link>https://zwrob.com/en/posts/backpack/</link>
			<pubDate>Sat, 21 Sep 2024 15:51:46 -0700</pubDate><guid>https://zwrob.com/en/posts/backpack/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>Kristin and I are preparing for a <code>LOW CARBON ADVENTURE</code>(tm).</p>
<ul>
<li><a href="https://stateparks.oregon.gov/index.cfm?do=v.page&amp;id=95" target="_blank" >South on the Oregon Coast Trail</a></li>
<li><a href="https://www.pcta.org/" target="_blank" >North on the Pacific Crest Trail</a></li>
</ul>
<p>We plan to spend about a year hiking, using as little carbon as possible. Realistically this means that we plan to either be walking, or traveling on public transportation&hellip;bus or train. We will not have a car, and we will not be flying.</p>
<p>As part of this, I designed and sewed my own backpack.</p>
<h2 id="diy-backpack">DIY Backpack<a href="#diy-backpack" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Clearly I am standing on the shoulders of giants. For those that want to sew a backpack (or tent), I recommend checking out <a href="https://www.rayjardine.com/Home/index.php" target="_blank" >Ray and Jenny&rsquo;s site</a>. I have sewed a number of their kits:</p>
<ul>
<li><a href="https://www.rayjardine.com/ray-way/Tarp-Kit/Net-Tent/index.php" target="_blank" >Net Tent</a></li>
<li><a href="https://www.rayjardine.com/ray-way/Quilt-Kit/index.php" target="_blank" >Quilt</a></li>
</ul>
<p>Note:</p>
<p>The umbrella is a key component. First popularized by <a href="https://en.wikipedia.org/wiki/A_Walk_Across_America" target="_blank" >Peter and Barbara Jenkins</a>.
Then, the father of ultralightweight hiking, Ray Jardine, picked it up and talked about it in their book, &ldquo;Trail Life&rdquo;, see:</p>
<ul>
<li><a href="https://www.rayjardine.com/ray-way/index.php" target="_blank" >https://www.rayjardine.com/ray-way/index.php</a></li>
<li><a href="https://www.rayjardine.com/ray-way/Books/Trail-Life/index.php" target="_blank" >https://www.rayjardine.com/ray-way/Books/Trail-Life/index.php</a></li>
<li><a href="https://www.rayjardine.com/Papers/Magazine-Articles/index.php?StoryPage=12.95" target="_blank" >https://www.rayjardine.com/Papers/Magazine-Articles/index.php?StoryPage=12.95</a></li>
</ul>
<p>Kristin purchased (but didn&rsquo;t end up building):</p>
<ul>
<li><a href="https://www.rayjardine.com/ray-way/Backpack-Kit/index.php" target="_blank" >Backpack</a></li>
</ul>
<p>I have sewed two of the net tents. On the second one, I opted to keep the design simple and ommitted the bat wings. I haven&rsquo;t used this tent yet, so I&rsquo;ll report back as to whether that was a good idea or not.</p>
<p>I&rsquo;ll mention it again, be sure to read <a href="https://www.rayjardine.com/ray-way/Books/Trail-Life/index.php" target="_blank" >Trail Life</a>.</p>
<p>For my backpack, I opted to design mine from scratch. I could (and probably should) have ordered a kit from the Jardine&rsquo;s&hellip; it&rsquo;s actually cheaper to order their kits than to purchase the fabric directly from my local fabric supplier. However, I just wanted the experience of starting from scratch.</p>
<p>Here&rsquo;s a photo trail of this journey&hellip;</p>
<h2 id="prototypes">Prototypes<a href="#prototypes" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="ultra-ultralight">Ultra-Ultralight<a href="#ultra-ultralight" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I made my first prototype out of 1.9 oz nylon&hellip; this is the sort of fabric I make stuff sacks out of. I am certain that a backpack made of this material would be a shredded mess in no time. But when I started out, it was exciting to have a backpack that weighed just a few ounces. I never completed this design with straps as it just seemed silly to continue.
<img src="/assets/2024/backpack/backpack01-a.jpg" alt="ultra-ultra-01">
<img src="/assets/2024/backpack/backpack01-b.jpg" alt="ultra-ultra-02"></p>
<h3 id="first-full-prototype-with-straps">First Full Prototype (with straps)<a href="#first-full-prototype-with-straps" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p><img src="/assets/2024/backpack/20240912_151432.jpg" alt="proto-01">
<img src="/assets/2024/backpack/20240912_151451.jpg" alt="proto-02">
<img src="/assets/2024/backpack/20240912_151522.jpg" alt="proto-03"></p>
<p>I used basting stitches to help fasten things as I sorted out where to put the straps and lifeters&hellip;
<img src="/assets/2024/backpack/20240912_151547.jpg" alt="basting"></p>
<p>A also used a fair bit of blue painters tape and black electrical tape while sorting out the shoulder straps. If you look closely at the photos, you&rsquo;ll see sewing with nothing attached&hellip; at first this wasn&rsquo;t a prototype. It was a failure. But then, once I freed my mind and just started hacking it apart and re-sewing it back together, what I wanted it to become started to take shape.
<img src="/assets/2024/backpack/20240912_151721.jpg" alt="tape"></p>
<h3 id="pattern-making">Pattern Making<a href="#pattern-making" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Once I had a pack that I liked, it was time to spit the pack apart along the side seams.
<img src="/assets/2024/backpack/20240912_152552.jpg" alt="split apart"></p>
<p>Then I flipped the pack over so that I could see all the features attached to the outside.
<img src="/assets/2024/backpack/20240912_152630.jpg" alt="outer features"></p>
<h3 id="making-the-pack">Making the Pack<a href="#making-the-pack" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>With the prototype spread out, I laid down my new fabric next to it, marked it, and cut it to length.
<img src="/assets/2024/backpack/20240912_153714.jpg" alt="fabric"></p>
<ul>
<li><a href="https://www.seattlefabrics.com/60-400-x-300-D-NylonPolyester-Diamond-Ripstop-1350-linear-yard_p_47.html" target="_blank" >Fabric : 60&quot; 400 x 300 D. Nylon/Polyester Diamond Ripstop @ $13.50/ linear yard</a></li>
</ul>
<p>I also cut the bottom reinforcement piece. Note that I have an electric fabric melty thingy in this photo. That tool works magic with meltable fabrics. However, while it&rsquo;s a must-have tool for cutting sunbrella&hellip; for a backpack, the melted ends are a little brittle and might chafe somewhere. So I ended up just using scissors for everything in this build.
<img src="/assets/2024/backpack/20240912_155839.jpg" alt="bottom reinforcement fabric"></p>
<ul>
<li><a href="https://www.seattlefabrics.com/58-420-D-X-420-D-Large-Diamond-Ripstop-NylonPolyester-1295-linear-yard_p_101.html" target="_blank" >Fabric : 58&quot; 420 D. X 420 D. Large Diamond Ripstop Nylon/Polyester @ $12.95/ linear yard</a></li>
</ul>
<p>The bottom is now reinforced.
<img src="/assets/2024/backpack/20240912_161243.jpg" alt="bottom reinforced"></p>
<p>I&rsquo;m laying a straight edege across the black fabric over to the blue fabric. The black fabric is the prototype turned into a template. I marked the center location for the bottom, using chalk, on both the template and the new fabric. From this point on I didn&rsquo;t really measure anything. I just transfered locations from the template to the new fabric, marked with chalk, and started sewing.
<img src="/assets/2024/backpack/20240912_161751.jpg" alt="layout"></p>
<p>I added a black patch for reinforcing the backpack and lifter attachment points.
<img src="/assets/2024/backpack/20240913_222053.jpg" alt="reinforce strap attachement"></p>
<p>I added the mesh bag for drying out my socks and underwear. Maybe I&rsquo;ll also put snacks here.
<img src="/assets/2024/backpack/20240913_234114.jpg" alt="mesh bag"></p>
<p>I <strong>love</strong> my umbrella. And I want to be able to cary lots of water. So these are the panels for those two features&hellip;
<img src="/assets/2024/backpack/20240914_115053.jpg" alt="umbrella and water bottle panels"></p>
<p>Panels sewed in.
<img src="/assets/2024/backpack/20240914_143921.jpg" alt="umbrella and water bottle features"></p>
<p>I reinforced these loops with some rainbow webbing.
<img src="/assets/2024/backpack/20240914_145721.jpg" alt="ice axe loops">
<img src="/assets/2024/backpack/20240914_145733.jpg" alt="rainbow webbing"></p>
<p>I had intended to run some thin ~1/8&quot; bungee cord on the back of my pack to hang a rain coat or something. These little black tabs worked great on a previous prototype. However, on the finished pack these were a PITA. When the fabric is folded over 2-4 times, this becomes really THICK and hard to sew. And I misjudged how long they need to be and only have of them are available to use in the finished pack. Next time I&rsquo;ll stagger how these get sewed and pull them back from the edge by 1/2&quot;.
<img src="/assets/2024/backpack/20240914_153013.jpg" alt="tabs"></p>
<p>Pickup strap and lifters. Again, I sized all of this on the prototype.
<img src="/assets/2024/backpack/20240914_170620.jpg" alt="lifters"></p>
<p>The straps are not hard, but there is some complexity in that the front webbing needs to be solidly attached to the strap. Otherwise there&rsquo;s this piece of webbing digging into you with out a pad between you and the webbing. I took the proto-pieces and turned them into templates.
<img src="/assets/2024/backpack/20240914_170746.jpg" alt="proto-strap"></p>
<p>Attaching straps to the pack.
<img src="/assets/2024/backpack/20240914_183653.jpg" alt="straps"></p>
<p>I hope my stitching holds.
<img src="/assets/2024/backpack/20240914_183710.jpg" alt="strap stitching"></p>
<p>Both straps attached.
<img src="/assets/2024/backpack/20240914_184220.jpg" alt="victory straps"></p>
<p>With all the features added to the outside of the pack, it&rsquo;s time to turn it inside out and sew the side seams. For this I switched from V-69 to V-92.
<img src="/assets/2024/backpack/20240914_190308.jpg" alt="inside-out"></p>
<p>The pack has been sewed inside out, with something like a flat felled seam&hellip;resulting in 4-6 layers of fabric&hellip; there is no way a normal sewing machine could do this. Make&rsquo;s me glad I purchased a used Juki walking foot industrial machine for this project.
<img src="/assets/2024/backpack/20240914_213139.jpg" alt="sewed inside out"></p>
<p>Right side out
<img src="/assets/2024/backpack/20240914_215728.jpg" alt="right side out"></p>
<p>Pack loaded up with umbrella, water bottle, a bear canister and some clothes inside.
<img src="/assets/2024/backpack/20240914_225724.jpg" alt="loaded up 1">
<img src="/assets/2024/backpack/20240914_225740.jpg" alt="loaded up 2"></p>
<h2 id="conclusion">Conclusion<a href="#conclusion" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Sewing this pack was a blast. It is probably heavier and more expensive than a kit would have been. However, I had fun designing it and testing out prototypes. Actually, I should mention that the design stage was kind of disheartening. I felt like I was wasting material and time and that I&rsquo;d eventually wind up buying a pack after spending $$$ trying to make one.</p>
<p>I definitely didn&rsquo;t save any money on this. And I&rsquo;d do a few things differently. But hey, now I know how to make a backpack and I have a cool holster for my umbrella!</p>
<h3 id="pack-weights">Pack Weights<a href="#pack-weights" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>My normal pack (Deuters internal frame) : 73oz</li>
<li>This pack as built : 20oz</li>
<li>The Jardine&rsquo;s pack : 13 oz</li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Maple Leaf Honey Bee Project</title>
			<link>https://zwrob.com/en/posts/mlbees/</link>
			<pubDate>Mon, 01 Apr 2024 16:25:19 -0700</pubDate><guid>https://zwrob.com/en/posts/mlbees/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><img src="/assets/2024/mays-bee-02.png" alt="butterfly"></p>
<p>We hope you are enjoying some of the honey from the Maple Leaf Honey Bee Project! This project is part of our ride on the roller coaster of thoughts and feelings about climate change. On our good days, we believe putting our attention on the climate emergency can generate some small solutions, and more closeness to other people and to nature. Below is a little about our journeys in backyard beekeeping.</p>
<p>We’d love to hear what you’re discovering on your own journey facing climate change. Feel free to email us (bees at zwrob dot com) stories of what is unfolding for you.</p>
<h2 id="todd">Todd&hellip;<a href="#todd" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p><img src="/assets/2024/mlbees-08.jpeg" alt="comb"></p>
<p>A few years ago I was wondering, &ldquo;What could I do, in my backyard, to fight
climate change?&rdquo; Somehow I stumbled upon <a href="http://zwrob.com/posts/eco-restoration-01/" target="_blank" >the idea of raising bees</a>, not for the
honey so much as to help pollinators. My thought was that helping pollinators can help
our local ecosystem. So I replaced my front yard with a <a href="https://en.wikipedia.org/wiki/H%C3%BCgelkultur" target="_blank" >hugelkultur</a> and started raising bees. <a href="http://zwrob.com/posts/eco-restoration-02/" target="_blank" >I involved friends and neighbors</a> by inviting them to host bee hives in their back yards, too. I&rsquo;m trying to breed a locally adapted variety of bees suited to our wet climate.</p>
<h2 id="kristin">Kristin&hellip;<a href="#kristin" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p><img src="/assets/2024/mlbees-04.jpeg" alt="crushing"></p>
<p>When I first met Todd he told me about the food forest he was creating in his yard. Pear and hazelnut trees, blackberry bushes, composting logs (a hugelkultur), and service berry and other native shrubs for the bees and critters to feast. <a href="http://zwrob.com/posts/eco-restoration-03/" target="_blank" >Last Fall I sowed native grass seeds</a> and this Spring we spread wildflower seeds. We&rsquo;re hoping they’ll grow into a Pacific Northwest prairie that feeds the finches, shelters the mice, and supplies the bees with even more pollen.</p>
<h2 id="other-paths">Other paths&hellip;<a href="#other-paths" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p><img src="/assets/2024/mlbees-05.jpeg" alt="honey"></p>
<p>The part of the journey we both love most is the connections with people&hellip; An old friend that was
hosting one of Todd’s hives in his yard has decided to take a bee keeping class and  has started keeping bees of his own.</p>
<p>Two young friends of ours have taken a keen interest in bees, and one even drew
the picture of a bee on this web page (thanks Mays!)</p>
<p>We’ve had dozens of neighbors stop and ask about the bees (and honey!).</p>
<p>If you are interested in joining us for one of our <a href="http://zwrob.com/posts/eco-restoration-03/#fall-2023---critter-house-painting-party" target="_blank" >critter parties</a>, then drop us an email.</p>
<p>&ndash;Todd and Kristin</p>
<h2 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Here are some links to organizations that we enjoy&hellip;</p>
<ul>
<li><a href="https://pugetsoundbees.org/psba-shopping/#!form/Shopping" target="_blank" >Puget Sound Beekeepers Association</a></li>
<li><a href="https://tilthalliance.org/" target="_blank" >Seattle Tilth Alliance</a></li>
<li><a href="https://tilthalliance.org/our-work/environmental-stewardship/master-composter-sustainability-stewards/" target="_blank" >Seattle Tilth + Seattle Public Utilities’ Master Composter/Sustainability Steward program</a></li>
<li><a href="https://transitriders.org/" target="_blank" >Transit Riders Union</a></li>
<li><a href="https://www.russvernonjones.org/" target="_blank" >Russ Vernon Jones (uplifting stories)</a></li>
<li><a href="https://outofthecloset.org/about/" target="_blank" >Out of the Closet Thrift Store in Capitol Hill takes clothes and household goods donations and supports testing and health care treatment for HIV/AIDS treatment</a></li>
<li><a href="https://refugeesarts.org/" target="_blank" >Refugee Artisan Initiative, takes textile donations that help women who are refugees create clothes, bags, and more for sale</a></li>
<li><a href="https://grist.org/" target="_blank" >Grist, for thoughtful, sometimes hopeful news about the climate</a></li>
<li><a href="https://www.seattle.gov/utilities/protecting-our-environment/sustainability-tips/waste-prevention/at-home/stop-food-waste" target="_blank" >Seattle waste prevention tips</a></li>
<li><a href="https://kingcd.org/" target="_blank" >King County Conservation District has lots of free videos and workshops about healthy soil and water and wildfire preparation, and they&rsquo;ll test your soil&rsquo;s nutrient content for free. P.S. we the public elect their Board of Supervisors!</a></li>
</ul>
<h2 id="related-posts">Related posts<a href="#related-posts" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="../eco-restoration-01/" >Eco Restoration 01</a></li>
<li><a href="../eco-restoration-02/" >Eco Restoration 02</a></li>
<li><a href="../eco-restoration-03/" >Eco Restoration 03</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Eco Restoration 03 : Bumblebees</title>
			<link>https://zwrob.com/en/posts/eco-restoration-03/</link>
			<pubDate>Sat, 16 Sep 2023 11:18:09 -0700</pubDate><guid>https://zwrob.com/en/posts/eco-restoration-03/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<h2 id="overview">Overview<a href="#overview" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Let&rsquo;s have a tiny critter house party!</p>
<p>Kristin and I created a bunch of bumble bee and mason bee houses, plus a stack of tiny bird houses. What follows are pics leading up to that, and from the party. At the end are some resource links for things like bees, polinators, and native prarie.</p>
<h2 id="pics">Pics<a href="#pics" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="fall-2023---start-a-prairie">Fall 2023 - Start a prairie<a href="#fall-2023---start-a-prairie" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Earlier this Fall, Kristin started to create a Prairie in the backyard. This involved rototilling the grass that was out there, watering to get weed seeds to germinate, and then covering the backyard in plastic to kill the newly germinated weed seeds. In early October, the plan is to plant native seeds.</p>
<p>This tiny rototiller was not up to the task&hellip;</p>
<ul>
<li><img src="/assets/2023/tiny-rototiller.jpg" alt="tiny-rototiller.jpg"></li>
<li><img src="/assets/2023/rototilling.jpg" alt="rototilling.jpg"></li>
</ul>
<p>A quick trip to HandyAndy and we are in business.</p>
<ul>
<li><img src="/assets/2023/more-rototilling.jpg" alt="more-rototilling.jpg"></li>
</ul>
<p>After the soil has been tilled, we laid plastic.</p>
<ul>
<li><img src="/assets/2023/laying-plastic.jpg" alt="laying-plastic.jpg"></li>
</ul>
<h3 id="fall-2023---build-critter-houses">Fall 2023 - Build Critter Houses<a href="#fall-2023---build-critter-houses" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I bought a staple gun and we went to work.</p>
<ul>
<li><img src="/assets/2023/tools.jpg" alt="tools.jpg"></li>
<li><img src="/assets/2023/more-building-bumbule-bee-houses.jpg" alt="more-building-bumbule-bee-houses.jpg"></li>
<li><img src="/assets/2023/building-bumble-bee-houses-02.jpg" alt="building-bumble-bee-houses-02.jpg"></li>
<li><img src="/assets/2023/building-bumble-bee-houses.jpg" alt="building-bumble-bee-houses.jpg"></li>
</ul>
<p>The bumble bee house is the most complicated of the houses. It has a little tube entrance into a &lsquo;mud room&rsquo;. Then there is the &rsquo;nesting room&rsquo; with a bunch of bedding material already there. Bumble bees like to nest in abandoned mice nests. Notice the nice bit of bedding&hellip;just leaves and grass I picked up off the driveway.</p>
<ul>
<li><img src="/assets/2023/inside-of-bumbule-bee-house.jpg" alt="inside-of-bumbule-bee-house.jpg"></li>
</ul>
<h3 id="fall-2023---critter-house-painting-party">Fall 2023 - Critter House Painting Party<a href="#fall-2023---critter-house-painting-party" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Now that we have built dozens of critter houses, we are ready to have a party and have folks come over and decorate these and then take them home. Here&rsquo;s the start of the day, before folks show up.</p>
<ul>
<li><img src="/assets/2023/sept-16-2023-01.jpeg" alt="sept-16-2023-01.jpeg"></li>
<li><img src="/assets/2023/sept-16-2023-02.jpeg" alt="sept-16-2023-02.jpeg"></li>
<li><img src="/assets/2023/sept-16-2023-03.jpeg" alt="sept-16-2023-03.jpeg"></li>
<li><img src="/assets/2023/sept-16-2023-04.jpeg" alt="sept-16-2023-04.jpeg"></li>
<li><img src="/assets/2023/sept-16-2023-05.jpeg" alt="sept-16-2023-05.jpeg"></li>
</ul>
<p>Results from the critter house painting party&hellip;</p>
<ul>
<li><img src="/assets/2023/green-bird-house.jpg" alt="green-bird-house.jpg"></li>
<li><img src="/assets/2023/IMG_20230916_164552369.jpg" alt="IMG_20230916_164552369.jpg"></li>
<li><img src="/assets/2023/IMG_20230916_164554184.jpg" alt="IMG_20230916_164554184.jpg"></li>
<li><img src="/assets/2023/IMG_20230916_164556860.jpg" alt="IMG_20230916_164556860.jpg"></li>
<li><img src="/assets/2023/IMG_20230916_164558809.jpg" alt="IMG_20230916_164558809.jpg"></li>
<li><img src="/assets/2023/IMG_20230916_164603426.jpg" alt="IMG_20230916_164603426.jpg"></li>
<li><img src="/assets/2023/red-and-blue-bird-houses.jpg" alt="red-and-blue-bird-houses.jpg"></li>
</ul>
<h2 id="resources">Resources<a href="#resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="bee-resources">Bee Resources<a href="#bee-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><a href="https://seattle.bibliocommons.com/v2/record/S30C3211335" target="_blank" >Mason Bee Revolution</a></li>
<li><a href="https://crownbees.com/" target="_blank" >Crown Bees</a></li>
<li><a href="https://www.beesinyourbackyard.com/post/how-to-make-a-bumble-bee-house" target="_blank" >Bumble Bee House Plans</a></li>
<li><a href="https://www.youtube.com/watch?v=yoMh0zpmaPY" target="_blank" >Mason Bee Mud Box</a></li>
</ul>
<h3 id="prarie-resources">Prarie Resources<a href="#prarie-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h2 id="related-posts">Related posts<a href="#related-posts" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="../eco-restoration-01/" >Eco Restoration 01</a></li>
<li><a href="../eco-restoration-02/" >Eco Restoration 02</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>News Sources</title>
			<link>https://zwrob.com/en/posts/news-sources/</link>
			<pubDate>Wed, 19 Oct 2022 07:52:00 -0700</pubDate><guid>https://zwrob.com/en/posts/news-sources/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>Here are the news sources I find interesting and tend to check often. I&rsquo;ll try
to keep this updated as I discover new sources that are useful to me. My litmus
test on proposed solutions to climate change is, &ldquo;what do native and indigenous
people say about it?&rdquo;. So first on my list is this proclamation from the
<a href="https://www.ienearth.org/kick-big-polluters-out-at-cop27/" target="_blank" >Indigenous Environmental
Network</a></p>
<pre><code>&quot;&quot;&quot;COP27 must be a reset of the system. A moment to abandon the old,
profiteering, polluting world order, and a time to reimagine and rapidly
implement global collaboration that centers equity, justice, science, and
humanity.&quot;&quot;&quot;
</code></pre>
<h2 id="international">international<a href="#international" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://democracynow.org" target="_blank" >democracy now</a></li>
<li><a href="https://commondreams.org" target="_blank" >common dreams</a></li>
<li><a href="https://www.blackagendareport.com/" target="_blank" >black agenda report</a></li>
<li><a href="https://www.russvernonjones.org" target="_blank" >russ&rsquo;s hopeful blog</a></li>
<li><a href="https://www.theguardian.com/us" target="_blank" >the guardian</a></li>
<li><a href="https://npr.org" target="_blank" >npr</a></li>
</ul>
<h2 id="environmental">environmental<a href="#environmental" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://globaljusticeecology.org/" target="_blank" >global justice ecology project</a></li>
<li><a href="https://ienearth.org" target="_blank" >indigenous environmental network</a></li>
</ul>
<h2 id="local-seattle--wa">local (seattle / wa)<a href="#local-seattle--wa" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://kodxseattle.org/eat-the-airwaves/" target="_blank" >eat the airwaves</a></li>
<li><a href="https://crosscut.com" target="_blank" >crosscut</a></li>
<li><a href="https://www.theurbanist.org" target="_blank" >the urbanist</a></li>
<li><a href="https://kexp.org" target="_blank" >kexp</a></li>
</ul>
<h2 id="tech">tech<a href="#tech" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://theregister.com" target="_blank" >the register</a></li>
<li><a href="https://slashdot.org" target="_blank" >slashdot</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Strawbale</title>
			<link>https://zwrob.com/en/posts/strawbale/</link>
			<pubDate>Tue, 04 Oct 2022 12:08:41 -0700</pubDate><guid>https://zwrob.com/en/posts/strawbale/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>My strawbale workshop photos:</p>
<ul>
<li><a href="https://photos.app.goo.gl/djw2KZJwBBiDonTb6" target="_blank" >https://photos.app.goo.gl/djw2KZJwBBiDonTb6</a></li>
</ul>
<p>Strawbale links:</p>
<ul>
<li><a href="https://strawbale.com/" target="_blank" >https://strawbale.com/</a></li>
<li><a href="https://strawbale.com/straw-bale-fire-resistant-southern-california/" target="_blank" >https://strawbale.com/straw-bale-fire-resistant-southern-california/</a></li>
<li><a href="https://strawbale.com/wildfires-straw-bale-construction/" target="_blank" >https://strawbale.com/wildfires-straw-bale-construction/</a></li>
<li><a href="https://limes.us/strawbale-walls-survive-california-fires/" target="_blank" >https://limes.us/strawbale-walls-survive-california-fires/</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Eco Restoration 02</title>
			<link>https://zwrob.com/en/posts/eco-restoration-02/</link>
			<pubDate>Thu, 08 Sep 2022 14:56:48 -0700</pubDate><guid>https://zwrob.com/en/posts/eco-restoration-02/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>I have this simple idea:</p>
<pre><code>We can reverse climate change.
</code></pre>
<h2 id="overview">Overview<a href="#overview" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I started this in <a href="../eco-restoration-01/" >Eco Restoration 01</a> back in 2020. Now it&rsquo;s 2022, so how are things going, what have I learned, and where are we going with this?
<a href="../eco-restoration-03/" >2023 Update </a>&hellip;</p>
<h3 id="pics">Pics<a href="#pics" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h5 id="spring-2022">Spring 2022<a href="#spring-2022" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<p>All my bees from last year died. So I ordered more bees, both packages and nucs.
I installed bees in my backyard and (key point) got neighbors interested in hosting
hives in their back yards. I have bees in 4 yards this year.</p>
<p>I also ordered some trees and shrubs to provide food for critters.</p>
<ul>
<li><img src="/assets/2022/spring-2022-bees-01.jpg" alt="spring-2022-bees-01.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-02.jpg" alt="spring-2022-bees-02.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-03.jpg" alt="spring-2022-bees-03.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-04.jpg" alt="spring-2022-bees-04.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-05.jpg" alt="spring-2022-bees-05.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-06.jpg" alt="spring-2022-bees-06.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-07.jpg" alt="spring-2022-bees-07.jpg"></li>
<li><img src="/assets/2022/spring-2022-bees-08.jpg" alt="spring-2022-bees-08.jpg"></li>
<li><img src="/assets/2022/spring-2022-front-hugulkulture-01.jpg" alt="spring-2022-front-hugulkulture-01.jpg"></li>
<li><img src="/assets/2022/spring-2022-lead-02.jpg" alt="spring-2022-lead-02.jpg"></li>
<li><img src="/assets/2022/spring-2022-leaf-02.jpg" alt="spring-2022-leaf-02.jpg"></li>
<li><img src="/assets/2022/spring-2022-side-yard.jpg" alt="spring-2022-side-yard.jpg"></li>
<li><img src="/assets/2022/spring-2022-trees-01.jpg" alt="spring-2022-trees-01.jpg"></li>
<li><img src="/assets/2022/spring-2022-trees-02.jpg" alt="spring-2022-trees-02.jpg"></li>
<li><img src="/assets/2022/spring-2022-trees-03.jpg" alt="spring-2022-trees-03.jpg"></li>
<li><img src="/assets/2022/spring-2022-trees-04.jpg" alt="spring-2022-trees-04.jpg"></li>
<li><img src="/assets/2022/spring-2022-trees-05.jpg" alt="spring-2022-trees-05.jpg"></li>
</ul>
<h5 id="summer-2022">Summer 2022<a href="#summer-2022" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<p>It&rsquo;s been a dry hot year. I installed some sprinklers to help the plants.</p>
<ul>
<li><img src="/assets/2022/summer-2022-apiary-01.jpg" alt="summer-2022-apiary-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-apiary-02.jpg" alt="summer-2022-apiary-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-backyard-hugulkulture-01.jpg" alt="summer-2022-backyard-hugulkulture-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-backyard-hugulkulture-02.jpg" alt="summer-2022-backyard-hugulkulture-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-bees-01.jpg" alt="summer-2022-bees-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-bees-02.jpg" alt="summer-2022-bees-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-bees-03.jpg" alt="summer-2022-bees-03.jpg"></li>
<li><img src="/assets/2022/summer-2022-front-house-yard-01.jpg" alt="summer-2022-front-house-yard-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-front-hugulkulture-02.jpg" alt="summer-2022-front-hugulkulture-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-hugulkulture-01.jpg" alt="summer-2022-hugulkulture-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-hugulkulture-02.jpg" alt="summer-2022-hugulkulture-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-hugulkulture-backyard-01.jpg" alt="summer-2022-hugulkulture-backyard-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-leaf-01.jpg" alt="summer-2022-leaf-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-mason-bee-house-01.jpg" alt="summer-2022-mason-bee-house-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-side-yard-01.jpg" alt="summer-2022-side-yard-01.jpg"></li>
<li><img src="/assets/2022/summer-2022-side-yard-02.jpg" alt="summer-2022-side-yard-02.jpg"></li>
<li><img src="/assets/2022/summer-2022-tree-nursery-01.jpg" alt="summer-2022-tree-nursery-01.jpg"></li>
</ul>
<h3 id="learnings">Learnings<a href="#learnings" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>Honey bees don&rsquo;t seem to do that well in the PNW winters</li>
<li>Native bees <em>love</em> the clover I planted on the hugulkultures</li>
<li>Logs take a long time to decompose</li>
<li>An old, used, low mileage, low range (~50 miles) Nissan Leaf has been a game changer. I have taken a few longer trips where I needed to fast charge. But mostly, my lifestyle has evolved to just driving in the 5 miles around me&hellip;to yoga or to get groceries. Otherwise, I take the bus, lightrail, or train. I still have a gas car, but I almost never use it.</li>
<li>I am going to increase my focus on planting a variety of flowers and plants for a variety of pollinators</li>
</ul>
<h3 id="other-thoughts">Other thoughts<a href="#other-thoughts" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I sold my sailboat this year. Then my partner and I joined a small sailing club and have been spending our weekends sailing dinghys around the local lake. So now I am spending a lot less money on a sail boat and actually sailing more. It&rsquo;s pretty fun sailing a dinghy around, and it&rsquo;s only a 5 minute drive to the beach. I might still go sailing around the world on a full size boat, but it certainly is interesting that I can have tons of fun doing something local, too.</p>
<h2 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="political">Political<a href="#political" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Global Justice Ecology &ndash; love this site</p>
<ul>
<li><a href="https://globaljusticeecology.org" target="_blank" >https://globaljusticeecology.org</a></li>
</ul>
<p>Maria Thomchick is amazing</p>
<ul>
<li><a href="https://kodxseattle.org/eat-the-airwaves/" target="_blank" >https://kodxseattle.org/eat-the-airwaves/</a></li>
</ul>
<p>I&rsquo;m sure you all know this one&hellip;</p>
<ul>
<li><a href="https://democracynow.org" target="_blank" >https://democracynow.org</a></li>
</ul>
<p>Russ sends a hopeful message to us through this site&hellip;</p>
<ul>
<li><a href="https://www.russvernonjones.org" target="_blank" >https://www.russvernonjones.org</a></li>
</ul>
<h3 id="building">Building<a href="#building" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I&rsquo;m thinking of ways to make our living spaces more ecological and fire resistant</p>
<ul>
<li><a href="https://strawbale.com/" target="_blank" >https://strawbale.com/</a></li>
<li><a href="https://strawbale.com/wp-content/uploads/Fire-ResistiveStrawbaleWalls-CASBA.pdf" target="_blank" >https://strawbale.com/wp-content/uploads/Fire-ResistiveStrawbaleWalls-CASBA.pdf</a></li>
</ul>
<h3 id="gardening">Gardening<a href="#gardening" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Check out the tall grass meadow plant list in the project resources section.</p>
<ul>
<li><a href="https://www.seattleparksfoundation.org/project/maple-leaf-reservoir-park/" target="_blank" >https://www.seattleparksfoundation.org/project/maple-leaf-reservoir-park/</a></li>
</ul>
<p>Here’s a good site with local native meadow plants and recommendations:</p>
<ul>
<li><a href="https://northwestmeadowscapes.com/" target="_blank" >https://northwestmeadowscapes.com/</a></li>
</ul>
<p>And if you’re gonna do some quantity, these guys are cheaper but have a $500 minimum.</p>
<ul>
<li><a href="http://www.heritageseedlings.com/native-seed" target="_blank" >http://www.heritageseedlings.com/native-seed</a></li>
</ul>
<p>I have purchased cover crops from these folks (clover, for example):</p>
<ul>
<li><a href="https://www.highmowingseeds.com/" target="_blank" >https://www.highmowingseeds.com/</a></li>
</ul>
<p>I have purchased several pounds of wildflower mixes here</p>
<ul>
<li><a href="https://www.seedsavers.org/bee-feed-mix" target="_blank" >https://www.seedsavers.org/bee-feed-mix</a></li>
</ul>
<p>And you can get free seeds from psba here:</p>
<ul>
<li><a href="https://pugetsoundbees.org/psba-shopping/#!form/Shopping" target="_blank" >https://pugetsoundbees.org/psba-shopping/#!form/Shopping</a></li>
</ul>
<p>A few years ago I ordered 100 packets and then walked around my neighborhood and gave them away to my neighbors&hellip;one packet at a time. I have no idea how many people planted them, but that sort of outreach can have a huge effect. I&rsquo;m doing the same thing this year&hellip;as soon as they send me the seeds.</p>
<p>I have purchased various trees and shrubs both locally from swansons and also from burnt ridge</p>
<ul>
<li><a href="https://www.burntridgenursery.com/" target="_blank" >https://www.burntridgenursery.com/</a></li>
</ul>
<h1 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>I&rsquo;m just playing around with the idea that if I change what&rsquo;s important to me, then my actions follow suit.And if I start making the planet and our ecosystem my priority, then &hellip; who knows what good can come of it?</p>
]]></content>
		</item>
		
		<item>
			<title>Eco Restoration 01</title>
			<link>https://zwrob.com/en/posts/eco-restoration-01/</link>
			<pubDate>Tue, 15 Sep 2020 07:42:31 -0700</pubDate><guid>https://zwrob.com/en/posts/eco-restoration-01/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>I have this simple idea:</p>
<pre><code>We can reverse climate change
</code></pre>
<h2 id="overview">Overview<a href="#overview" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>To this end, I&rsquo;ve started several simple projects around my house:</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/H%C3%BCgelkultur" target="_blank" >hugulkultur</a></li>
<li><a href="http://horizontalhive.com/" target="_blank" >beehives</a></li>
<li><a href="https://www.pugetsoundbees.org/wp-content/uploads/2013/06/BeeFriendlyPlantsBrochure-2.1.pdf" target="_blank" >plants</a></li>
</ul>
<h2 id="my-3-step-plan">My 3 Step Plan<a href="#my-3-step-plan" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ol>
<li>Build Soil</li>
<li>Encourage Nature</li>
<li>Goto 1</li>
</ol>
<p>Clearly I don&rsquo;t know what I&rsquo;m doing, but hey, we all have to start somewhere. In fact, #2 is really part of #1. So this simplifies to:</p>
<ol>
<li>Encourage Nature</li>
<li>Goto 1</li>
</ol>
<p>I guess #1 is:</p>
<p>a. build soil
b. encourage bees
c. encourage fungi
d. &hellip; what else?</p>
<p>So, with that nav chart, here we go:</p>
<h2 id="summer-of-2020">Summer of 2020<a href="#summer-of-2020" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="build-soil">Build Soil<a href="#build-soil" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>A call to an arborist and I have a big pile of logs:</p>
<ul>
<li><img src="/assets/woodpile.jpeg-web.jpeg" alt="woodpile"></li>
</ul>
<p>Time with a come-along and my logs are up in my front yard:</p>
<ul>
<li><img src="/assets/hugel-log-base.jpeg-web.jpeg" alt="hugel-log-base.jpeg-web.jpeg"></li>
</ul>
<p>While you can try to get wood chips from <em>chipdrop.com</em>, I&rsquo;ve had better luck just calling arborists directly.</p>
<ul>
<li><img src="/assets/free-woodchips.jpeg-web.jpeg" alt="free-woodchips"></li>
</ul>
<p>Put chips on logs, plant things, and see what happens:</p>
<ul>
<li><img src="/assets/hugel-with-woodchips.jpeg-web.jpeg" alt="hugel-with-woodchips"></li>
<li><img src="/assets/covering-hugel-01.jpeg-web.jpeg" alt="covering-hugel"></li>
<li><img src="/assets/covering-hugel.jpeg-web.jpeg" alt="covering-hugel"></li>
<li><img src="/assets/dirt-on-hugel.jpeg-web.jpeg" alt="dirt-on-hugel"></li>
<li><img src="/assets/frontyard-hugelkulture-with-apple-cuttings.jpeg-web.jpeg" alt="frontyard-hugelkulture-with-apple-cuttings"></li>
<li><img src="/assets/front-yard-panorama.jpeg-web.jpeg" alt="front-yard-panorama"></li>
<li><img src="/assets/hugel00.jpeg-web.jpeg" alt="hugel00"></li>
<li><img src="/assets/hugel01.jpeg-web.jpeg" alt="hugel01"></li>
<li><img src="/assets/hugel02.jpeg-web.jpeg" alt="hugel02"></li>
<li><img src="/assets/hugel-with-apple-tree-cuttings.jpeg-web.jpeg" alt="hugel-with-apple-tree-cuttings"></li>
</ul>
<p>Ok, hugel is going. I&rsquo;l check back on this from time 2 time&hellip;</p>
<h3 id="encourage-bees">Encourage Bees<a href="#encourage-bees" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I&rsquo;m following the advice of Dr. Leo Sharaskin:</p>
<ul>
<li><a href="https://www.youtube.com/results?search_query=dr.&#43;leo&#43;sharashkin" target="_blank" >Sharaskin YouTube Videos</a></li>
<li><a href="http://horizontalhive.com/how-to-build/layens-swarm-trap-plans.shtml" target="_blank" >Swarm Catcher Plans</a></li>
<li><a href="http://horizontalhive.com/how-to-build/layens-hive-frame-plans.shtml" target="_blank" >Frame Plans</a></li>
<li><a href="http://horizontalhive.com/how-to-build/layens-beehive-design.shtml" target="_blank" >Beehive Plans</a></li>
<li><a href="http://horizontalhive.com/keeping-bees-with-a-smile/fedor-lazutin-book.shtml" target="_blank" >Book 1</a></li>
<li><a href="http://horizontalhive.com/keeping-bees-with-a-smile/georges-layens-book.shtml" target="_blank" >Book 2</a></li>
</ul>
<p>A couple of thoughts&hellip;</p>
<ul>
<li>I just watched enough of the videos and read enough of the books to know I
wanted to do this. Then I just started doing it.</li>
<li>The swarm catcher and beehives are really well thought out</li>
<li>I modified the frames to be way way less work to build. I&rsquo;ll post my modified
plans soon, but the key difference is that I just router a 3/4&quot; slot in the
underside of the top bar instead of wasting all the material suggested. And
instead of slabbing 2&quot;x10&quot; or whatever&hellip;I just use 1&quot;x8&quot; and rip 1&quot; strips
for both the side and bottom bars. This reduces the work to create the frames
by orders of magnitude. TODO: post side-by-side photos.</li>
</ul>
<p>I started this project by building and deploying 8 swarm catchers:</p>
<ul>
<li><img src="/assets/painted-swarm-catcher-hives.jpeg-web.jpeg" alt="painted-swarm-catcher-hives"></li>
<li><img src="/assets/swarm-catcher-in-tree.jpeg-web.jpeg" alt="swarm-catcher-in-tree"></li>
<li><img src="/assets/swarm-catcher-on-chair.jpeg-web.jpeg" alt="swarm-catcher-on-chair"></li>
</ul>
<p>On to building the full size beehives&hellip;</p>
<p>I set primitive stops for all the lumber cutting:</p>
<ul>
<li><img src="/assets/cutting-lumber-for-full-size-hive.jpeg-web.jpeg" alt="cutting-lumber-for-full-size-hive"></li>
</ul>
<p>After some time, I have frame parts:</p>
<ul>
<li><img src="/assets/frame-parts-in-bins.jpeg-web.jpeg" alt="frame-parts-in-bins"></li>
<li><img src="/assets/hive-frames.jpeg-web.jpeg" alt="hive-frames"></li>
</ul>
<p>Top bars go in here, and then I run this over a router table with a 3/4&quot; bit:</p>
<ul>
<li><img src="/assets/jig-for-top-bars.jpeg-web.jpeg" alt="jig-for-top-bars"></li>
</ul>
<p>Hives get heavy:</p>
<p>Cutting stock:</p>
<ul>
<li><img src="/assets/hive-stock-jig.jpeg-web.jpeg" alt="hive-stock-jig"></li>
</ul>
<p>Assembly:</p>
<ul>
<li><img src="/assets/hive-assembly-00.jpeg-web.jpeg" alt="hive-assembly-00."></li>
<li><img src="/assets/hive-assembly-01.jpeg-web.jpeg" alt="hive-assembly-01"></li>
<li><img src="/assets/hive-assembly.jpeg-web.jpeg" alt="hive-assembly"></li>
<li><img src="/assets/full-size-hives.jpeg-web.jpeg" alt="full-size-hives"></li>
<li><img src="/assets/router-hive-openings.jpeg-web.jpeg" alt="router-hive-openings"></li>
</ul>
<p>Glueup:</p>
<ul>
<li><img src="/assets/hive-glue-up-01.jpeg-web.jpeg" alt="hive-glue-up-01"></li>
<li><img src="/assets/hive-glue-up.jpeg-web.jpeg" alt="hive-glue-up"></li>
<li><img src="/assets/hive-openings.jpeg-web.jpeg" alt="hive-openings"></li>
<li><img src="/assets/hives-after-glue-up.jpeg-web.jpeg" alt="hives-after-glue-up"></li>
<li><img src="/assets/hives-glue-drying.jpeg-web.jpeg" alt="hives-glue-drying"></li>
<li><img src="/assets/hives-in-driveway.jpeg-web.jpeg" alt="hives-in-driveway"></li>
</ul>
<p>Painting:</p>
<ul>
<li><img src="/assets/unpainted-hives.jpeg-web.jpeg" alt="unpainted-hives"></li>
<li><img src="/assets/painted-hives.jpeg-web.jpeg" alt="painted-hives"></li>
</ul>
<p>Adding Frames:</p>
<ul>
<li><img src="/assets/hives-filling-with-frames.jpeg-web.jpeg" alt="hives-filling-with-frames"></li>
<li><img src="/assets/hives-wired.jpeg-web.jpeg" alt="hives-wired"></li>
</ul>
<p>West side of my house. Dry. Covered in cardboard. I&rsquo;ll plant clover here in the spring.</p>
<ul>
<li><img src="/assets/west-side-yard.jpeg-web.jpeg" alt="west-side-yard"></li>
</ul>
<p>Here&rsquo;s my denuded backyard. Perfect to start a restoration project:</p>
<ul>
<li><img src="/assets/backyard-beehives.jpeg-web.jpeg" alt="backyard-beehives"></li>
</ul>
<h2 id="the-summary">The Summary<a href="#the-summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Ok, I have bees checking out the lavender in my yard. But so far, no bees have
moved into my hives. I&rsquo;ll add blog posts as things progress.</p>
<h1 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="https://www.pugetsoundbees.org/" target="_blank" >https://www.pugetsoundbees.org/</a></li>
<li><a href="https://en.wikipedia.org/wiki/H%C3%BCgelkultur" target="_blank" >https://en.wikipedia.org/wiki/H%C3%BCgelkultur</a></li>
<li>beehives](<a href="http://horizontalhive.com" target="_blank" >http://horizontalhive.com</a></li>
<li><a href="https://www.pugetsoundbees.org/wp-content/uploads/2013/06/BeeFriendlyPlantsBrochure-2.1.pdf" target="_blank" >https://www.pugetsoundbees.org/wp-content/uploads/2013/06/BeeFriendlyPlantsBrochure-2.1.pdf</a></li>
</ul>
<h1 id="books">Books<a href="#books" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<ul>
<li><a href="http://horizontalhive.com/keeping-bees-with-a-smile/fedor-lazutin-book.shtml" target="_blank" >http://horizontalhive.com/keeping-bees-with-a-smile/fedor-lazutin-book.shtml</a></li>
<li><a href="http://horizontalhive.com/keeping-bees-with-a-smile/georges-layens-book.shtml" target="_blank" >http://horizontalhive.com/keeping-bees-with-a-smile/georges-layens-book.shtml</a></li>
<li><a href="https://www.powells.com/book/mycelium-running-how-mushrooms-can-help-save-the-world-9781580085793" target="_blank" >https://www.powells.com/book/mycelium-running-how-mushrooms-can-help-save-the-world-9781580085793</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Northwest Power and Conservation Council : Oct 15/16 2019 Meeting</title>
			<link>https://zwrob.com/en/posts/nwpcc01/</link>
			<pubDate>Thu, 17 Oct 2019 10:58:23 -0700</pubDate><guid>https://zwrob.com/en/posts/nwpcc01/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<ul>
<li><a href="https://www.nwcouncil.org/about" target="_blank" >NWPCC About</a></li>
<li><a href="https://www.nwcouncil.org/meeting/council-meeting-october-15-2019" target="_blank" >Meeting</a></li>
</ul>
<p>My informal notes:</p>
<h2 id="power-committee--oct-15-2019-830am-pacific-time--hoh-room">Power Committee – Oct 15 2019 8:30am Pacific time – Hoh Room<a href="#power-committee--oct-15-2019-830am-pacific-time--hoh-room" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="update-on-progress-of-genesys-redevelopment">Update on Progress of GENESYS Redevelopment<a href="#update-on-progress-of-genesys-redevelopment" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>NWPCC has developed a finer grained flow modelling system called, GENESYS that
aims to either replace or at least complement the venerable HYDSYM?</p>
<h4 id="context">Context<a href="#context" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li><a href="https://www.nwcouncil.org/energy/energy-advisory-committees/system-analysis-advisory-committee/request-for-proposals-redevelopment-of-the-genesys-model" target="_blank" >GENESYS RFP</a></li>
<li><a href="https://www.nwcouncil.org/energy/energy-advisory-committees/system-analysis-advisory-committee/genesys-%E2%80%93-generation-evaluation-system-model" target="_blank" >GENESYS</a></li>
<li><a href="https://www.epa.gov/ceam/hydrological-simulation-program-fortran-hspf" target="_blank" >HSPF</a></li>
<li><a href="https://en.wikipedia.org/wiki/Hydrological_transport_model" target="_blank" >Wikipedia hydrologic modeling</a></li>
<li><a href="https://duckduckgo.com/?q=HYDSYM&#43;modelling&#43;river&#43;flow&amp;t=canonical&amp;ia=web" target="_blank" >proprietary flow modeling software</a></li>
</ul>
<p>Note: I cannot find reference to HYDSYM, though I did find reference
to HSPF.</p>
<h4 id="notes">Notes<a href="#notes" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>modeling hourly constraints for thinking about markets</li>
<li>are currently calibrating the model with BPA and other stakeholders</li>
<li>aggregate hydro -&gt; plant specific dispatch (shape matters)</li>
<li>previous model was all in FORTRAN, moving to modernize the model (language?)</li>
<li>lots of non-power constraints in model, e.g. fish</li>
<li>vetting with river operators</li>
<li>model tries to emulate time frames for markets</li>
</ul>
<p>One key difference that was discussed at length was the difference in the
monthly model of HYDSYM vs. the moving to the finer grained weekly model.</p>
<ul>
<li>goal: verify that GENESYS results match HYDSYM, which is made a little tricky b/c
weekly boundaries do not always fall on monthly boundaries, therefore some interpolation
is required in GENESYS</li>
</ul>
<h4 id="council-member-questions">Council member questions<a href="#council-member-questions" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Questions</p>
<ul>
<li>are/is GENESYS using the same or similar constraints as BPA?</li>
<li>will the results be radically different than BPA vs CRSO vs NWPP?</li>
</ul>
<p>Answers</p>
<ul>
<li>No. Results will be roughly the same, modulo minor variance introduced by interpolations.</li>
</ul>
<h4 id="buzzwords">Buzzwords<a href="#buzzwords" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>KSFD</li>
<li>Aurora</li>
<li>CRSO</li>
<li>SCCT</li>
<li>GRAC : generating resources advisory committee</li>
<li>NWEC : northwest energy coalition</li>
</ul>
<h4 id="references">References<a href="#references" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>The Seventh Power Plan was referenced repeatedly:</p>
<ul>
<li><a href="https://www.nwcouncil.org/energy/7th-northwest-power-plan/about-seventh-power-plan" target="_blank" >7th Power Plan</a></li>
</ul>
<h3 id="load-forecast">Load Forecast<a href="#load-forecast" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Load forecast based on:</p>
<ul>
<li>population growth and migration</li>
<li>behind the meter solar</li>
<li>transport / EV penetration
-&gt; results in the load forecast</li>
</ul>
<h4 id="data-sources">Data sources<a href="#data-sources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<h5 id="population">Population<a href="#population" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<ul>
<li>ACS data for population flows (subset of census)</li>
<li>Global Insight (apparently this is used all throughout the industry for population modelling)</li>
<li>IHS-Global Insights : population growth is main driver</li>
</ul>
<h5 id="solar">Solar<a href="#solar" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<ul>
<li>EIA : energy information administration : annual energy outlook</li>
<li>SEDS : state energy data systems</li>
<li>NREL : system advisory model</li>
<li>Energy2020 : load forecasting tool</li>
<li>&ldquo;cogen&rdquo; : affects energy (aMW) and peak (MW)</li>
<li>forecast an aggressive build out of solar: ~5 MW additional capacity from 2025 and 2041</li>
<li>solar will be very useful for peak load reduction in summer</li>
</ul>
<p>However, a council member questioned this last point, pointing out that the
supply and demand are offset by several hours in Idaho and the response was
that the model was aggregated at a monthly level. I find this somewhat strange
and IMHO this analysis relies on the supply and demand being matched, either
naturally or via some sort of load shift (hydro/battery/etc.).</p>
<h5 id="ev-transport">EV Transport<a href="#ev-transport" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<ul>
<li>late afternoon peak as drivers arrive home and charge vehicles</li>
<li>expect an increased electric load from EVs</li>
<li>low auto turnover rate will limit velocity of EV penetration</li>
<li>charging profiles from AVISTA</li>
<li>drivers : population growth, vehicle retirement, vehicle efficiency</li>
<li>network transmission costs vs p2p</li>
<li>look at the interconnection queue</li>
</ul>
<h3 id="solar-battery-storage-and-solar--battery-storage-reference-plants">Solar, Battery Storage, and Solar + Battery Storage Reference Plants<a href="#solar-battery-storage-and-solar--battery-storage-reference-plants" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>This presentation was far too detailed for me to take notes. Hopefully the
slide decks are available.</p>
<hr>
<h2 id="council-meeting--oct-15-2019-130pm-pacific-time--nooksack-room">Council Meeting – Oct 15, 2019 1:30pm Pacific time – Nooksack Room<a href="#council-meeting--oct-15-2019-130pm-pacific-time--nooksack-room" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="presentation-by-the-orca-task-force-dr-les-purce-and-stephanie-solien-co-chairs-of-the-orca-task-force">Presentation by the Orca Task Force: Dr. Les Purce and Stephanie Solien, Co-Chairs of the ORCA Task Force.<a href="#presentation-by-the-orca-task-force-dr-les-purce-and-stephanie-solien-co-chairs-of-the-orca-task-force" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I did not take notes on this, suffice to say, the situation is looking really really bad for both Salmonids and Orcas.</p>
<h3 id="briefing-on-water-resources-in-the-pacific-northwest-as-related-to-marine-heat-waves-el-nino-and-climate-change-dr-nick-bond-washington-state-climatologist">Briefing on water resources in the Pacific Northwest as Related to Marine Heat Waves, El Nino, and Climate Change: Dr. Nick Bond, Washington State Climatologist.<a href="#briefing-on-water-resources-in-the-pacific-northwest-as-related-to-marine-heat-waves-el-nino-and-climate-change-dr-nick-bond-washington-state-climatologist" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Summary</p>
<ul>
<li>lots of variability, but the trends are
<ul>
<li>warmer weather, less cloud cover? esp summers, leading to increased
evapotranspiration, esp in summers</li>
<li>shift in precip from snow to rain</li>
<li>shift in precip to wetter winters (rain) and drier summers</li>
<li>precip changes result in changes to the flow curves of rivers
<ul>
<li>less snow release dominant</li>
<li>more rain release dominant</li>
<li>release times shifted towards wetter winters</li>
</ul>
</li>
</ul>
</li>
<li>overall, these systemic changes are going to occur slowly over the next 50
years with lots of variability</li>
</ul>
<p>My comments: if you look at the cold water refuges plan and the forecast for
the change in precip patterns, you should probably be alarmed. Salmonids like
cool rivers and tend to die in water that is too warm. We are def looking at
lower spring flows which are also warmer. Uh oh.</p>
<p>I chatted with Dr.Bond after his presentation and suggested that one could
misinterpret his message as, &ldquo;we do not have to worry about climate change in
the PNW&rdquo;. He said that is definitely not the message he is intending to
deliver.  We also chatted about a new term called, &lsquo;climate privilege&rsquo;, that
describes how folks in places like the PNW actually have privilege, much like
&lsquo;white privilege&rsquo;, of not having to react as quickly as people in other
locales.</p>
<hr>
<h2 id="2020-regional-technical-forum-work-plan--oct-16-2019-900-am-pacific-time">2020 Regional Technical Forum Work Plan – Oct 16 2019 9:00 am Pacific Time<a href="#2020-regional-technical-forum-work-plan--oct-16-2019-900-am-pacific-time" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>RTF : regional technical forum</li>
<li>NG : natural gas analysis</li>
<li>residential building model</li>
<li>connect disparate utilities ~ coordinate research</li>
<li>DR : 3% of budget ~= 50K
<ul>
<li>EE + DR (energy efficiency and demand response)</li>
<li>tools need to be improved, historically focused on EE, not DR</li>
</ul>
</li>
<li>Expand scope of RTF charter to include both EE + DR, and NG efficiency</li>
</ul>
<h2 id="update-on-key-environmental-protection-agency-activities-in-the-columbia-river-basin---oct-16-2019-10-am-pacific-time">Update on key Environmental Protection Agency activities in the Columbia River Basin - Oct 16 2019 10 am Pacific Time<a href="#update-on-key-environmental-protection-agency-activities-in-the-columbia-river-basin---oct-16-2019-10-am-pacific-time" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>Chris Hladick, Regional Administrator, US EPA Region 10</li>
<li><a href="https://www.epa.gov/columbiariver/2009-state-river-report-toxics" target="_blank" >State of the River Report</a></li>
<li>Action Plan for the Columbia River Basin Restoration Act
<ul>
<li><a href="https://www.congress.gov/bill/114th-congress/house-bill/2469/text" target="_blank" >https://www.congress.gov/bill/114th-congress/house-bill/2469/text</a></li>
<li><a href="https://www.congress.gov/congressional-report/111th-congress/senate-report/358/1?r=5" target="_blank" >https://www.congress.gov/congressional-report/111th-congress/senate-report/358/1?r=5</a></li>
</ul>
</li>
<li><a href="https://nepis.epa.gov/Exe/ZyNET.exe/P100XHV1.TXT?ZyActionD=ZyDocument&amp;Client=EPA&amp;Index=2016&#43;Thru&#43;2020&amp;Docs=&amp;Query=&amp;Time=&amp;EndTime=&amp;SearchMethod=1&amp;TocRestrict=n&amp;Toc=&amp;TocEntry=&amp;QField=&amp;QFieldYear=&amp;QFieldMonth=&amp;QFieldDay=&amp;IntQFieldOp=0&amp;ExtQFieldOp=0&amp;XmlQuery=&amp;File=D%3A%5Czyfiles%5CIndex%20Data%5C16thru20%5CTxt%5C00000014%5CP100XHV1.txt&amp;User=ANONYMOUS&amp;Password=anonymous&amp;SortMethod=h%7C-&amp;MaximumDocuments=1&amp;FuzzyDegree=0&amp;ImageQuality=r75g8/r75g8/x150y150g16/i425&amp;Display=hpfr&amp;DefSeekPage=x&amp;SearchBack=ZyActionL&amp;Back=ZyActionS&amp;BackDesc=Results%20page&amp;MaximumPages=1&amp;ZyEntry=1&amp;SeekPage=x&amp;ZyPURL" target="_blank" >2019 Status Update: Columbia River Basin Toxics Reduction</a></li>
<li>$1M Jan 2019 Grant Program</li>
<li>DOJ appealing water quality models (I don&rsquo;t understand the issues here)</li>
<li><a href="https://www.epa.gov/columbiariver/columbia-river-cold-water-refuges" target="_blank" >Draft Cold Water Refuges Plan</a></li>
<li>Identified 23 areas where cool tributaries enter the Columbia, 12 of which are critical b/c they account for ~80%? of cold water in system</li>
<li>EPA concludes there are enough refuges now but will not be in the future</li>
<li>Accepting feedback until Dec 3</li>
<li><a href="https://www.columbiariverkeeper.org/" target="_blank" >River Keeper Agreements</a>
<ul>
<li>permits regulate only some pollutants</li>
</ul>
</li>
<li>Flex Spill Agreement
<ul>
<li><a href="https://archive.fisheries.noaa.gov/wcr/fish_passage/fcrps_opinion/flexible-spill-operations.html" target="_blank" >https://archive.fisheries.noaa.gov/wcr/fish_passage/fcrps_opinion/flexible-spill-operations.html</a></li>
<li><a href="https://www.bpa.gov/news/newsroom/Pages/Flexible-spill-agreement-aims-to-benefit-salmon-and-hydropower.aspx" target="_blank" >https://www.bpa.gov/news/newsroom/Pages/Flexible-spill-agreement-aims-to-benefit-salmon-and-hydropower.aspx</a></li>
<li>states develop their own guidelines for TDL and then the EPA has to vet/approve them?</li>
</ul>
</li>
</ul>
<p>Council Question</p>
<ul>
<li>main stem TMDL cold water refuge?</li>
</ul>
<p>Answer:</p>
<ul>
<li>TMDL : total maximum daily load : heat contributions</li>
<li><a href="https://duckduckgo.com/?q=cold&#43;water&#43;refuges&#43;report&amp;t=canonical&amp;ia=web" target="_blank" >refuges report</a> -&gt; importance of places for fish during times of warmer temp regimes
<ul>
<li>not embedded in the TMDL&hellip;what does this mean?</li>
</ul>
</li>
</ul>
<p>Council Question:</p>
<ul>
<li>What are the contaminants? What are the measurements?</li>
<li>Do you measure the surface? Where are the points of compliance?</li>
</ul>
<p>Answer:</p>
<ul>
<li>variability in time of year, location on stream system, depth</li>
<li>mitigation opportunities are cool regions that vary by TOD, TOY, season, etc.</li>
<li>many different fed/state/tribal entities are involved</li>
</ul>
<p>Council Question:</p>
<ul>
<li>Are requirements different for adult spawning vs juveniles escaping?</li>
<li>Main stem is a corridor, not a spawning ground</li>
<li>Year round temp standard unnecessary b/c only important when fish are present, right?</li>
</ul>
<p>Answer</p>
<ul>
<li>Web of water quality standards. Varies by season, and use by fish</li>
<li>Focus is on TOY when fish are present and temps are up</li>
<li>Refuges give fish a place to shelter so they can rest before moving on</li>
</ul>
<p>Council Question:</p>
<ul>
<li>Who is going to manage the cold water refuges?</li>
</ul>
<p>Answer:</p>
<ul>
<li>EPA is identifying where they are, how to protect and enhance, but implementation
and management is up to the states</li>
</ul>
<p>Council Question:</p>
<ul>
<li>What about upstream pollutants from Canada? Area of the Kootenay&hellip;Note:
a coal mine and effluent/tailings ponds were mentioned, but the coal
company was not identified.</li>
</ul>
<p>Answer:</p>
<ul>
<li>State Department interacts with Canada</li>
<li>Environment Canada is the Canadian agency</li>
</ul>
<h2 id="briefing-on-regional-energy-future-from-an-independent-power-producer-perspective-orijit-ghoshal-invenergy---oct-16-2019-1045-am-pacific-time">Briefing on regional energy future from an independent power producer perspective: Orijit Ghoshal, Invenergy. - Oct 16 2019 10:45 am Pacific Time<a href="#briefing-on-regional-energy-future-from-an-independent-power-producer-perspective-orijit-ghoshal-invenergy---oct-16-2019-1045-am-pacific-time" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>IPP : Independent Power Producer
<ul>
<li>developer / builder/ operator</li>
<li>not affiliated with a utility monopoly</li>
<li>no rate payer or guaranteed cash inflow</li>
<li>need long term agreements for revenue certainty</li>
<li>transmission rights are different (no eminent domain for one thing)</li>
</ul>
</li>
<li>fuel supply and transmission rights are not firm</li>
<li>do not require firm supply and transmission</li>
<li>do not have imminent domain rights</li>
<li>need voluntary agreements with landowners (currently ~16K locations)</li>
<li>need close partnerships for those agreements</li>
<li>Invenergy the largest IPP in North America
<ul>
<li>developing desalination plants</li>
<li>23GW nameplate capacity</li>
<li>33B in capital</li>
<li>sell a lot of stuff to Pacificorp</li>
</ul>
</li>
<li>listed a bunch of wind farms
<ul>
<li>Hood River : 72MW sells directly to LADWP</li>
<li>Grand Ridge : batter - PJAM freq regulation market, sub-second response</li>
</ul>
</li>
<li>600MW deployed wind generation across 13 facilities
<ul>
<li>used to take 2 years to develop a wind farm, now it&rsquo;s down to 1.25 years</li>
<li>time frame for a battery facility is on order of months (and they can be
relocated as necessary)</li>
</ul>
</li>
<li>BPA owns 75% of PNW transmission</li>
<li>zero cost dispatch of resources makes economic sense</li>
<li>energy flows from CA &lt;-&gt; WA are changing</li>
<li>opportunity for IPP to enter the market</li>
<li>example scenario
<ul>
<li>low air pressure in winter -&gt; cloud cover, low wind, and cold weather</li>
<li>need non solar non wind energy supply</li>
<li>(seems like trying to sell their gas gen plant that is in danger of being
stranded)</li>
</ul>
</li>
<li>BPA is not FERC regulated</li>
<li>all generators are revenue sources for BPA</li>
<li>resource adequacy requirements for 8GW?</li>
<li>interconnection challenges
<ul>
<li>siting</li>
<li>low hanging fruit (sites that are flat w/ good wind or solar) have been
taken</li>
<li>constrained by physical characteristics</li>
<li>solar cost curve is declining faster than wind</li>
<li>federal tax credits for solar expire later than wind</li>
<li>(explains the rush on wind farms ATM, gotta build and complete before
credits expire)</li>
</ul>
</li>
<li>still need to address load</li>
<li>to get financing, need firm transmission rights, but transmission is limited</li>
<li>need increased transmission capacity in the system</li>
<li>firm transmission reservations are made 24x7 and typically day ahead&hellip;but
these reservations are not being used 100%, in fact they are only used a
small percentage of the time, so the system is booked but under utilized</li>
<li>RECS : renewable energy credits - that&rsquo;s what Facebook is buying with it&rsquo;s
wind farm/solar? project, not the actual electricity, which will be sold on
the market</li>
<li>firm zero carbon energy : code named &lsquo;unicorn&rsquo; project : can be done with BPA
hydro. but w/o a firm backing source like hydro, this is pretty expensive to
do with current batteries, etc.</li>
<li>transmission congestion
<ul>
<li>need a region wide operator</li>
<li>need a single market</li>
<li>advocating with american wind energy association and renewable energy
northwest, and others</li>
</ul>
</li>
<li>when to buy / sell an asset?
<ul>
<li>outlook on asset performance</li>
<li>transmission injection rights</li>
<li>use of money</li>
<li>development transfer - build and sell facilities more and more as
utilities become more comfortable with RE tech, and the utilities have a
preference to own rather than PPA</li>
</ul>
</li>
<li>given high demand for assets, Invenergy is selling them and using the
$$$ to purchase transmission rights</li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Gridforward2019</title>
			<link>https://zwrob.com/en/posts/gridforward2019/</link>
			<pubDate>Fri, 11 Oct 2019 07:23:41 -0700</pubDate><guid>https://zwrob.com/en/posts/gridforward2019/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>Personal notes from <a href="https://gridforward.org/events/gridfwd-2019/" target="_blank" >GridForward2019</a>.</p>
<p>I haven&rsquo;t made any effort to clean these up other than to find relevant links that I&rsquo;ll
research later.</p>
<p>&ndash;Todd</p>
<h2 id="openadr"><a href="https://www.openadr.org/" target="_blank" >OpenADR</a><a href="#openadr" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Presenters: Rolf Bienert and Don Duichinos</p>
<ul>
<li>Oasis Inter operation created by <a href="https://www.oasis-open.org/" target="_blank" >Oasis Open</a></li>
<li>Sends requests not commands, customers can opt in/out</li>
<li>Service events have start/end/intervals</li>
<li>Service events can be re-sent with updates (there&rsquo;s a sequence number)</li>
<li>Security is PKI based</li>
<li>Security model vetted by:
<ul>
<li><a href="https://www.nist.gov/" target="_blank" >NIST</a></li>
<li><a href="https://sepapower.org/" target="_blank" >SGIP #1</a></li>
<li><a href="https://en.wikipedia.org/wiki/Smart_Grid_Interoperability_Panel" target="_blank" >SGIP #2</a></li>
<li><a href="https://www.ieci.org/" target="_blank" >IEC</a></li>
<li><a href="https://en.m.wikipedia.org/wiki/SCADA" target="_blank" >SCADA</a></li>
</ul>
</li>
</ul>
<h3 id="questions">Questions<a href="#questions" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>How are certs revoked and/or updated (CRL for revocation)</li>
<li>Can organizations provide their own CA (Yes)</li>
<li>How are upgrades performed? OTA?</li>
<li>Are commands idempotent? Is every command ack&rsquo;d or is this fire-and-forget?</li>
</ul>
<h3 id="also-discussed">Also discussed<a href="#also-discussed" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><a href="https://standards.ieee.org/standard/2030_5-2018.html" target="_blank" >2030.5</a> IEEE
2030.5-2018 - IEEE Standard for Smart Energy Profile Application Protocol</li>
<li><a href="http://eprijournal.com/can-we-talk/" target="_blank" >CTA-2045</a> Port to dispatch (control)
water heaters</li>
<li><a href="https://www.cpuc.ca.gov/Rule21/" target="_blank" >CA Rule 21</a></li>
<li>R.A.T.E.S.org &ndash; I cannot find this site</li>
<li><a href="https://www.qualitylogic.com/industries/smart-energy/smart-energy-systems-services-for-utilities/" target="_blank" >Quality
Logic</a>
has online learning for OpenADR</li>
</ul>
<h2 id="derms">DERMS<a href="#derms" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>What is DERMS? Where are you in that value chain?</li>
<li>Is it a distribution tool? A transmission tool?</li>
<li>3 Forms/lineages
<ul>
<li><a href="https://www.next-kraftwerke.com/vpp/virtual-power-plant" target="_blank" >VPP</a> Virtual Power Plant</li>
<li><a href="https://www.schneider-electric.com/en/work/solutions/for-business/electric-utilities/advanced-distribution-management-system-adms/" target="_blank" >ADMS</a>Advanced Distribution Management System</li>
<li><a href="https://ets18.co/news/derms-vpps-and-ders-whats-the-difference-and-why-should-you-care/" target="_blank" >Hybrid</a></li>
</ul>
</li>
<li>EMS/GMS ?</li>
<li><a href="https://www.greencitytimes.com/green-building/hem/" target="_blank" >HEM</a></li>
<li>Australia soon 40% of their gen will be on the customer side</li>
<li>Advance forecasting, load flow, load management, asset use</li>
<li>Devices behind the meter: settlement, delivery, back office management</li>
<li>&ldquo;We&rdquo; have no idea how to change business processes when deploying DRMS:
<ul>
<li>interconnection permits, DR group, ops group</li>
<li>utilities actively looking at this</li>
<li>have to learn how to manage DERS</li>
</ul>
</li>
<li>Capacity relief on a substation
<ul>
<li>forecast DERS, monitor, how is it registered?</li>
<li>ADMS registration? Need an interconnected update process</li>
<li>reactive power? interconnect agreements?</li>
</ul>
</li>
<li>Operators need response on the system</li>
<li>Market structures, policies, programs</li>
<li>How to unify perspectives?</li>
</ul>
<h2 id="bc-hydro">BC Hydro<a href="#bc-hydro" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>Problem With Theft</li>
<li>Collecting 2M metrics on hourly/5/15minute intervals</li>
<li>Transformer impedance / voltage profile -&gt; looking for anomalies</li>
<li>Energy balancing : reconciling billing vs generation, looking for theft or data quality errors</li>
<li>Drivers: large theft scenario of grow ops
<ul>
<li>secondary issues of safety</li>
<li>theft totalled 7% of load, equivalent to ~80K homes</li>
<li>leads to premature asset failure (transformer overload)</li>
</ul>
</li>
<li>AMI - enhanced field investigation team</li>
<li>Over time, theft teams went from 60% to 5% of investigations resulting in identifying theft</li>
<li>Result: $732M in savings</li>
<li>Q: Does the result factor in the theft detection costs (system creation, maintenance, investigation teams, etc.)?</li>
<li>Used external solution to start, Data Raker, from 2011 to 2014</li>
<li>Used DR while developing in-house solution</li>
<li>Deployed DR and in-house solution side-by-side</li>
<li>A/B systems compared in final analysis</li>
<li>Key takeaways:
<ul>
<li>IT/OT bridge : the business and technical relationships were key</li>
</ul>
</li>
<li>Maintenance system is at 78TB currently and grows by 6TB/month</li>
<li>Stack uses Greenplum and HortonWorks</li>
</ul>
<h2 id="oh-der">Oh DER!<a href="#oh-der" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>Status Quo is lacking framework for incentivizing storage</li>
<li>Opportunity to decarbonize / digitize / and democratize</li>
<li>Create monetization and value</li>
<li>Pricing and billing engine for TOD pricing took 10 years</li>
</ul>
<p>Strategy across industry</p>
<ul>
<li>
<p>Breaking down silos</p>
</li>
<li>
<p>What or the goals and objectives?</p>
</li>
<li>
<p>Evaluate framework / value streams / DOU / Rate designs</p>
</li>
<li>
<p>Need financing mechanisms to bring systems to people that cannot afford 10K for a battery system</p>
</li>
<li>
<p>Need confidence in data</p>
</li>
</ul>
<p>What&rsquo;s needed in the regulatory environment?
&hellip;crickets.</p>
<h2 id="pathways-to-deep-decarbonization">Pathways to Deep Decarbonization<a href="#pathways-to-deep-decarbonization" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>
<p><a href="https://www.nwcouncil.org/" target="_blank" >Northwest Power and Conservation Council</a></p>
<ul>
<li>2021 Power Plan
<ul>
<li><a href="https://www.nwcouncil.org/meeting/council-meeting-october-15-2019" target="_blank" >Next Meeting</a></li>
<li>Adequate power system</li>
<li>Protect fish and wildlife</li>
<li>Do this within the power plan process
<ul>
<li>energy efficiency</li>
<li>DR</li>
<li>geothermal?</li>
<li>transmission</li>
</ul>
</li>
<li>70M buildings using natural gas</li>
<li><a href="http://eprijournal.com/can-we-talk/" target="_blank" >CTA-2045</a> Port to dispatch (control) water heaters</li>
</ul>
</li>
</ul>
</li>
<li>
<p><a href="https://www.pse.com/" target="_blank" >PSE</a></p>
<ul>
<li>transmission - IRP</li>
<li>distribution - planning is somewhat separate
<ul>
<li>generation</li>
<li>smart grid &amp; AMI &amp; batteries &amp; self-healing -&gt; increased reliability and flexibility</li>
<li>feeder deployments have decreased outages</li>
<li>trees lead to outages on the grid</li>
<li>w/o digitization decarbonization won&rsquo;t happen</li>
</ul>
</li>
<li>Analytics
<ul>
<li><a href="https://nwess.ece.uw.edu/2018/Presentations/2-1%20Josh%20Jacobs.pdf" target="_blank" >Get To Zero</a></li>
<li>Multiple types of customers : low-income -&gt; AWS/Nordstroms (data centers)</li>
<li>anticipate and proactively solve problems</li>
<li>Web/billing/payments/operational</li>
<li>AMI - 2023 <a href="https://www.landisgyr.com/" target="_blank" >Landis &amp; Gyr</a></li>
<li>Used to be on their board of directors</li>
<li>Something about customer preferences</li>
</ul>
</li>
<li>Resiliency/Micro-grid
<ul>
<li><a href="https://www.pse.com/pages/grid-modernization/glacier-demo-project" target="_blank" >Example 2MW in Glacier Whatcom County</a></li>
<li>10mi long radial ~ 100&quot; snow/year</li>
<li>difficult to restore power</li>
<li>battery installed allowing</li>
<li>restored power in August</li>
<li>large commercial / military customers</li>
</ul>
</li>
<li>Pilots &amp; Partnerships Ecosystem
<ul>
<li>Pilots allow controlled ecosystem w/ controlled costs</li>
<li>Responsible to customers and the environment</li>
<li>Game Changers
<ul>
<li>EV infrastructure</li>
<li>WA - 40% of carbon emissions are from transport</li>
<li>WA - 50K electric vehicles</li>
<li>WA - project 400K - 1M by 2030</li>
<li>UpNGo &ndash; can test drive EV vehicles? Cannot find link</li>
<li>Heavy transport / Maritime</li>
<li>Pro LPNG facility in Tacoma</li>
</ul>
</li>
</ul>
</li>
<li>Hoped for achievements in 5 years
<ul>
<li>No Cyber Security events</li>
<li>Cost effectively meet goals in clean energy</li>
<li>D&amp;I - unconscious bias / trust / etc.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="cyber-cyber">Cyber Cyber<a href="#cyber-cyber" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="what-are-the-top-cyber-risks">What are the top Cyber risks?<a href="#what-are-the-top-cyber-risks" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer">Answer<a href="#answer" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>build relationships before incidents happen</li>
<li><a href="https://en.wikipedia.org/wiki/Stuxnet" target="_blank" >stuxnet</a></li>
<li><a href="https://en.wikipedia.org/wiki/Havex" target="_blank" >halvex</a></li>
<li>it&rsquo;s an evolution</li>
<li>not going to see the exact same thing, cannot predict threat vectors</li>
<li>build resiliency models to detect, categorize, react to threats</li>
</ul>
<h3 id="who-faces-cyber-attacks">Who faces Cyber attacks?<a href="#who-faces-cyber-attacks" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-1">Answer<a href="#answer-1" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>today, distribution</li>
<li>targets of opportunity, places w/ most potential for damage</li>
<li>as distribution becomes hardened, then attacks move</li>
<li>transmission is expected next</li>
</ul>
<h3 id="what-about-vendors-what-role-do-they-play">What about vendors? What role do they play?<a href="#what-about-vendors-what-role-do-they-play" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-2">Answer<a href="#answer-2" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>recent attacks via vendor pathways</li>
<li>old devices w/ old vulnerabilities</li>
<li>new devices w/ vulnerabilities, un-encrypted firmware is easily examined and rooted</li>
<li>not signing firmware, even large firmware vendors</li>
<li>micro-grids with smaller companies in these spaces may not have resources to properly
defend against these attacks (however it was also stated that the larger companies
are also doing a poor job of defending, so seems a bit FUD).</li>
<li><a href="https://public.cyber.mil/stigs/srg-stig-tools/" target="_blank" >STIG</a> Open Source threat modeling software</li>
</ul>
<h3 id="what-role-do-regulations-play">What role do Regulations Play?<a href="#what-role-do-regulations-play" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-3">Answer<a href="#answer-3" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li><a href="https://www.energy.gov/" target="_blank" >DOE</a></li>
<li><a href="https://www.ferc.gov/" target="_blank" >FERC</a></li>
<li><a href="https://www.nist.gov/" target="_blank" >NIST</a></li>
<li><a href="https://www.nerc.com/Pages/default.aspx" target="_blank" >NERC</a></li>
<li><a href="http://www.icscanada.ca/images/upload/ICS%20OPS%20Description2012.pdf" target="_blank" >IC Level Chain</a></li>
<li><a href="https://www.weforum.org/agenda/2018/06/managing-risk-in-the-energy-sector-s-cyber-supply-chain/" target="_blank" >IC Level Chain</a></li>
<li>NERC - focus on legacy environments, on the cusp of engaging with the cloud</li>
<li>NERC - does not have language? for cloud cyber security</li>
<li>Threat Vectors
<ul>
<li>Infra</li>
<li>Operations</li>
<li>Data protection</li>
</ul>
</li>
<li>Weakest link is humans</li>
<li>Employees must be aware of attack vectors</li>
<li>Leaders must start investing in employee awareness</li>
<li>Awareness training is a constant thing</li>
</ul>
<h3 id="what-happened-in-march">What happened in March?<a href="#what-happened-in-march" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-4">Answer<a href="#answer-4" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>Fishing attack, stage 1 malware</li>
<li>Followed by lot&rsquo;s of, trust us, sorry, we have to keep secrets, blah blah</li>
</ul>
<h3 id="what-happened-in-the-ukraine">What happened in the Ukraine?<a href="#what-happened-in-the-ukraine" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-5">Answer<a href="#answer-5" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li><a href="https://www.cyber.nj.gov/threat-profiles/ics-malware-variants/blackenergy" target="_blank" >Blackenergy3</a></li>
<li>not designed to attack the grid</li>
<li>stage 1 -&gt; 4</li>
<li>found value</li>
<li>attacked SCADA</li>
<li>deleted stage 1 and started scavenging for VPN connections</li>
<li>managed routers and switches have VPNs into target environments</li>
</ul>
<h3 id="how-to-trust-vendors">How to trust Vendors?<a href="#how-to-trust-vendors" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="answer-6">Answer<a href="#answer-6" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>Segmented networks</li>
<li>2FA</li>
<li>Scoped roles/access to the secure resources/networks</li>
<li>Verify vendor compliance</li>
<li>Do not blindly trust vendors or their compliance</li>
<li>Pen tasting?</li>
<li>Validate, check policies, use 3rd parties for risk management</li>
<li>Need to involve cyber-security from the beginning</li>
<li><a href="https://www.incibe-cert.es/en/blog/cyber-kill-chain-applied-ics" target="_blank" >ICS Kill Chain</a></li>
<li>Procurement process (RFP) needs to have cyber-security as part of the process</li>
</ul>
<h3 id="threat-monitoring">Threat Monitoring<a href="#threat-monitoring" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>visibility fabric devices</li>
<li>anomaly detection devices</li>
<li>what to do with alerts? need to invest in human capital to deal with alerts and make meaningful decisions</li>
<li>train from within</li>
<li><a href="https://www.nerc.com/pa/CI/CIPOutreach/Pages/GridEx.aspx" target="_blank" >Gridex</a> Government training for incidents</li>
<li><a href="https://www.sans.org/" target="_blank" >SANS.org</a> Has paid training for ICS</li>
</ul>
<h3 id="other-resources">Other resources<a href="#other-resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><a href="https://defcon.org/" target="_blank" >Defcon</a></li>
<li><a href="https://www.blackhat.com/" target="_blank" >Blackhat</a></li>
<li><a href="https://www.icscybersecurityconference.com/" target="_blank" >ICS Security Conference</a></li>
<li><a href="http://houstonseccon.org/" target="_blank" >Houston Security Conference</a></li>
<li><a href="https://pipelinerspodcast.com/episode-22-gamification-cybersecurity-clint-bodungen/" target="_blank" >Follow &ldquo;Clint Bodungen&rdquo;</a></li>
<li><a href="http://www.robertmlee.org/" target="_blank" >Follow &ldquo;Robert Lee&rdquo;, owner of dragos</a></li>
</ul>
<h2 id="public-power">Public Power<a href="#public-power" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="flathead-electric">Flathead Electric<a href="#flathead-electric" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>relying on customer networks and modems was a disaster</li>
<li>water heater controller has high acquisition cost</li>
<li>BPA does not supply real time information (costs)</li>
<li>Degraded the battery installed at a youth home by 20% in 5 years
by cycling from 0 -&gt; 100% charge</li>
<li>TOD rates</li>
<li>Micro-grid an a 330 mile radial feed</li>
</ul>
<h3 id="burbank">Burbank<a href="#burbank" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>not part of CAISO, part of LADWP</li>
<li>cannot use market to help w/ intermittent resources</li>
<li>100% smart meters</li>
<li>vertically integrated</li>
<li>EV charging TOU rates</li>
<li>fiber over the city</li>
<li>local gen</li>
</ul>
<h3 id="fort-collins">Fort Collins<a href="#fort-collins" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>biz cases</li>
<li>fund outcomes not departments -&gt; 7 outcome areas</li>
<li>electric utility is under multiple departments -&gt; outcome is safe community</li>
<li>3x bottom line : economic / social / environmental -&gt; changes how you think and do business</li>
</ul>
<h3 id="flathead">Flathead<a href="#flathead" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>need big thinkers, don&rsquo;t be afraid, take chances</li>
</ul>
<h3 id="burbank-1">Burbank<a href="#burbank-1" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>costs now provide benefits later</li>
<li>hoover dam as an example</li>
<li>had vision and big thinking</li>
<li>integrating RE for the environment is new vocabulary</li>
<li>think in decades</li>
</ul>
<h3 id="biggest-forward-thinking-investments">Biggest Forward Thinking Investments?<a href="#biggest-forward-thinking-investments" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="burbank-2">Burbank<a href="#burbank-2" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>Inter-mountain Power Project (IPP) - 18MW Coal Plant</li>
<li>Online since the &rsquo;80s</li>
<li>working to accelerate plant shutdown and replacement with NG plant</li>
<li>Southern Transmission System</li>
<li>50 year commitment to a gas plant</li>
<li>Renewable hydrogen?</li>
<li>the best of many imperfect solutions</li>
</ul>
<h4 id="flathead-1">Flathead<a href="#flathead-1" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>coop</li>
<li>know your audience / members</li>
<li>local gen was asked for</li>
<li>landfill to gas plant - first in Montana</li>
<li>timber manufacturer - biomass -&gt; energy</li>
<li>community solar</li>
<li>members are willing</li>
</ul>
<h4 id="ft-collins">Ft Collins<a href="#ft-collins" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>One of 6 places of invention mentioned in a Smithsonian exhibit</li>
<li>500K cost share was from community members</li>
<li>Collaboration and partnership</li>
<li>High-tech area</li>
<li>Climate economy</li>
</ul>
<h3 id="key-takeaways">Key Takeaways?<a href="#key-takeaways" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>No shareholders</li>
<li>No state regulations</li>
<li>Local control and accountability</li>
<li>Not mandated as investor owned utilities are</li>
<li>Taking shareholders &amp; regulators out of the equation -&gt; yields advantages and more resilient decision making process</li>
</ul>
<h2 id="gw-of-der">GW of DER<a href="#gw-of-der" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>&hellip;</p>
<h2 id="regulation-and-innovation">Regulation and Innovation<a href="#regulation-and-innovation" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="regulators-need-the-same-level-of-detail-as-a-cfo">&ldquo;Regulators need the same level of detail as a CFO&rdquo;<a href="#regulators-need-the-same-level-of-detail-as-a-cfo" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>whole plan</li>
<li>future sunk costs</li>
<li>mitigating risks</li>
<li>societal benefits</li>
</ul>
<h2 id="random-bits">Random Bits<a href="#random-bits" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://duckduckgo.com/?q=irp&#43;integrated&#43;resource&#43;plan&amp;t=canonical&amp;ia=web" target="_blank" >IRP</a>
Integrated Resource Plan</li>
<li><a href="https://www.washingtonvotes.org/2019-SB-5116" target="_blank" >WA State Bill 5116</a>2019 Senate
Bill 5116: Supporting Washington&rsquo;s clean energy economy and transitioning to
a clean, affordable, and reliable energy future</li>
<li><a href="https://app.leg.wa.gov/billsummary?BillNumber=1444&amp;Year=2019" target="_blank" >WA State Bill
1444</a>Concerning appliance efficiency standards.</li>
<li>In WA transport is 45% of our GHG emissions</li>
<li><a href="https://www.techopedia.com/definition/31047/advanced-metering-infrastructure-ami" target="_blank" >AMI</a> Smart Meters (bi-directional)</li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Energy Analytics Project - Part 2 : How To</title>
			<link>https://zwrob.com/en/posts/eap02/</link>
			<pubDate>Tue, 17 Sep 2019 09:42:32 -0700</pubDate><guid>https://zwrob.com/en/posts/eap02/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><img src="https://raw.githubusercontent.com/energy-analytics-project/energy-dashboard/master/docs/assets/jupyter-06.png" alt="A Jupyter Notebook"></p>
<p>I introduced the <a href="https://github.com/energy-analytics-project/energy-dashboard" target="_blank" >Energy Analytics
Project</a> in my
previous blog post, <a href="../eap01" >Energy Analytics Project - Part 1 :
BackStory</a>.</p>
<p>This post will dive into how to use this project and hopefully give you some
ideas for how to extend and contribute to it.</p>
<p>The following posts will dive into the more technical aspects of how, what, and
why as well as highlight some of the false starts, dead-ends, frustrations and
successes of trying to create a data-centric application.</p>
<h2 id="how-to--getting-started">How To / Getting Started<a href="#how-to--getting-started" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I wrote a <a href="https://github.com/energy-analytics-project/energy-dashboard/blob/master/docs/howto.md" target="_blank" >How To / Getting Started Guide
here</a>.
Rather than repeat that information, I&rsquo;ll assume you&rsquo;ve read that page and want
even more of an introduction or ideas for how to use this project.</p>
<h2 id="beyond-getting-started">Beyond Getting Started<a href="#beyond-getting-started" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>OK, so you&rsquo;ve played around with a data set or two, you&rsquo;ve read through the
CAISO documentation that describes the various data feeds that are available&hellip;
now what?</p>
<p>Here&rsquo;s where things take off.</p>
<p>Together, we need to figure out how to answer basic regional questions like:</p>
<ul>
<li>What are our real hard vs soft energy needs?</li>
<li>What are our predicted energy needs over the next 20-50 years?</li>
<li>How can we most cost-effectively de-carbonize?</li>
<li>How can we do that in ways that build community, empower citizens, and
reverse discriminatory impacts to &lsquo;front line&rsquo; communities?</li>
</ul>
<h2 id="democratize-data">Democratize Data<a href="#democratize-data" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I propose that freely available data and analysis is critical for our success.</p>
<p>My reason for putting this project together is to serve as a model going
forward. CAISO has published enough data that we can reason about that market.
I&rsquo;d like to get similar data sets from Oregon, Washington, Idaho and Montana. If
we can get some idea as to the shapes of these different markets and how they
can be beneficial to each other, then we can make real progress.</p>
<p>I&rsquo;ve written some ideas on that
<a href="https://github.com/energy-analytics-project/energy-dashboard/blob/master/docs/background.md" target="_blank" >here</a>.</p>
<p>One thing that I&rsquo;m very concerned with is restricted access to data. We need
public access to data, public analysis and counter analysis, and informed
decision making.</p>
<h2 id="pitch">Pitch<a href="#pitch" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>So the <em>beyond-getting-started</em> pitch is:</p>
<ul>
<li>Help determine which data sets are useful for understanding the California markets</li>
<li>Help retrieve those data sets from the other states (I can help with this)</li>
<li>If the data sets are not available, then help cultivate relationships
and retrieve those data sets</li>
</ul>
<h2 id="how-can-you-help">How can you help?<a href="#how-can-you-help" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li>Join the <a href="https://groups.google.com/d/forum/energy-analytics-project" target="_blank" >mailing list</a></li>
<li>Become a contributor &ndash; this is <a href="https://www.gnu.org/licenses/gpl-3.0.html" target="_blank" >Free Software</a>, contributions are welcome</li>
<li>Become a data curator &ndash; help me source new data sets and manage the existing ones</li>
<li>Become a data scientist &ndash; start creating Jupyter Notebooks and sharing your knowledge</li>
</ul>
<p>And if you are a domain expert in either data science or the energy sector, please
jump in and lend your expertise.</p>
<p>In the next post, I&rsquo;m going to dive in and discuss the platform architecture, the tooling, and
how the design trade offs interact with daily use. When posted, it&rsquo;ll be here:
<a href="../eap03" >Energy Analytics Project - Part 3 : Architecture</a>.</p>
<p>-Todd</p>
]]></content>
		</item>
		
		<item>
			<title>Energy Analytics Project - Part 1 : Back Story</title>
			<link>https://zwrob.com/en/posts/eap01/</link>
			<pubDate>Mon, 16 Sep 2019 07:20:00 -0700</pubDate><guid>https://zwrob.com/en/posts/eap01/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><a href="https://github.com/energy-analytics-project/energy-dashboard" target="_blank" >Energy Analytics Project</a>
<img src="https://raw.githubusercontent.com/energy-analytics-project/energy-dashboard/master/docs/caiso/caiso-oasis-avg-fuel-prices-and-fuel-prices-breakout.png.png" alt="CAISO Fuel Prices" title="CAISO Fuel Prices"></p>
<h2 id="back-story">Back Story<a href="#back-story" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I took this summer (2019) off to address the climate crisis. Somehow, there
must be a way for software engineers, like myself, to affect climate change&hellip;
and what better avenue than the energy sector?</p>
<p>For starters, I attended a couple of energy conferences. That&rsquo;s where I learned
about the price of electricity going negative in California. Apparently, solar
electricity generation peaks a few hours before consumer demand for cooling
peaks. It&rsquo;s also where I learned about our Pacific Northwest hydro electricity
prices going negative during certain flood events. Apparently, during flood
events that coincide with salmon runs, the dams run excess water through the
turbines to protect the fish. However, because this energy was not asked for
and is just dumped onto the grid, this causes the price of electricity to go
negative. I also learned that there are significant amounts of wind energy in
Idaho and Montana&hellip; (Unfortunately, these presentations were anecdotal and I do
not have the data to back up any of these assertions. Not quite.)</p>
<p>So the question is, how can we integrate and optimize the energy sector for
renewable energy (and most importantly, decarbonizing the energy sector)?</p>
<p>About this time a friend told me about the data available on the <a href="http://oasis.caiso.com" target="_blank" >CAISO
OASIS</a> site, and something clicked. You see, this site
exposes an enormous amount of energy related data for the state of California
(in fact, CAISO stands for California Independent Service Operator). If someone
could consolidate data feeds in the energy sector, across the western region of
CA, OR, WA, ID, MT, then perhaps we could analyze that data from the
perspective of decarbonization? How can we most effectively use renewable and
non-renewable energy sources?</p>
<p>To answer these questions, I created the Energy Analytics Project (EAP) and it
is currently pulling down over 90 separate data feeds from CAISO OASIS,
totalling about 1.5 million time-series data points.</p>
<p>In this blog post I&rsquo;m going to introduce this project, describe why I think
it&rsquo;s interesting, and why I think you should join me and help out.</p>
<p>So, read on to find out more about this project&hellip;</p>
<h2 id="primary-objective">Primary Objective<a href="#primary-objective" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Decarbonize the energy sector.</p>
<p>I&rsquo;ve written a background piece on why I started this
<a href="https://github.com/energy-analytics-project/energy-dashboard" target="_blank" >project</a>
<a href="https://github.com/energy-analytics-project/energy-dashboard/blob/master/docs/background.md" target="_blank" >here</a>.</p>
<p>That should give you a general grounding for project intent, namely, let&rsquo;s get
enough data to make informed decisions about our investments in the energy
sector.</p>
<h3 id="goals">Goals<a href="#goals" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Create a community of developers, researchers, data scientists, and
policy advocates, each leveraging the skills of the others.</p>
<h4 id="community">Community<a href="#community" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Developers, like me, help by providing the infrastructure and tooling to get
data into one place, in an accessible platform. The platform I chose to start
with is:</p>
<ul>
<li>source code in github</li>
<li>data in S3 buckets</li>
<li>databases in Sqlite3</li>
<li>reports in Jupyter Notebooks</li>
<li>distributed via github</li>
</ul>
<p>My hope is that researchers and data scientists will start consuming this data
and start generating reports. Then, we need policy advocates to start using
these reports to affect the decisions being made at Federal, Regional, State
and local levels.</p>
<h4 id="tooling">Tooling<a href="#tooling" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Provide adequate tooling for managing all this data.  I&rsquo;ll defer further
discussion of the tooling to a later post as that&rsquo;s the rabbit hole that I am
always drawn to.</p>
<h4 id="research">Research<a href="#research" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Data scientists use a common set of tools, so this project should accommodate
that. To that end, the tooling is based on Python3, Jupyter Notebooks, and
Pandas. However, you can use whatever tooling you want, write your own data
pipeline, whatever, it doesn&rsquo;t matter. One thing that may be unusual about
this project, however, is that all the data is surfaced as Sqlite3 databases.
The primary artifact of each data feed is a Sqlite3 database.</p>
<h3 id="why-is-this-interesting">Why is this interesting?<a href="#why-is-this-interesting" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>For me, it&rsquo;s intrinsically interesting to get such detailed information about
the worlds 5th largest economy and how it&rsquo;s energy sector functions. But what&rsquo;s
more interesting is taking the CAISO model and evangelizing this type of data
transparency to other agencies in the West. If we can get some small subset of
the OASIS data feeds from entities like Bonneville Power Administration (BPA),
and the western states such as Oregon, Washington, Idaho and Montana&hellip; then we
can start to understand the potential costs and benefits of different types of
energy resources, pricing strategies, etc. at a regional scale.</p>
<p>As the need to de-carbonize the energy sector becomes more and more apparent,
we will need to make important decisions about where to invest our time and
money.  Do we build nuclear reactors, and if so why and where? What is the
time-cost and ROI for this? Should be invest in solar, wind, or hydro? Are
these systems built in a way that is complementary, e.g. are we using our hydro
for capacitive storage?  What is the cost for each of these solutions? How much
of the demand can be shifted by live pricing?</p>
<p>There are a lot of questions to be answered here, and we need this data to be
easily and publicly accessible so that we, any and all of us, can get started
with trying to make sense out of the situation.</p>
<h3 id="how-can-you-get-involved">How can you get involved?<a href="#how-can-you-get-involved" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Please join the <a href="https://github.com/energy-analytics-project/energy-dashboard" target="_blank" >Energy Analytics Project mailing list</a>.</p>
<p>See <a href="../eap02" >Energy Analytics Project - Part 2 : How To</a> for instructions
on how to get started with this platform.</p>
<p>&ndash;Todd</p>
]]></content>
		</item>
		
		<item>
			<title>Erlang 01 : Where is the Golden Path?</title>
			<link>https://zwrob.com/en/posts/erlang-01/</link>
			<pubDate>Sat, 13 Jul 2019 08:34:58 -0700</pubDate><guid>https://zwrob.com/en/posts/erlang-01/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>I&rsquo;m slowly learning <a href="https://www.erlang.org/" target="_blank" >Erlang</a>. It&rsquo;s taken me more than 10 years to get to
where I am now&hellip;which, frankly, isn&rsquo;t very far. I thought I&rsquo;d share some newbie
thoughts from a veteran software developer with over 25 years of experience in
the industry.</p>
<h1 id="history">History<a href="#history" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>From 2009 to 2019&hellip;</p>
<ul>
<li>read books <a href="https://github.com/ToddG/experimental/blob/master/erlang/resources/books.md" target="_blank" >(Joe, Fred, etc.)</a></li>
<li>write little code snippets</li>
<li>post little <a href="https://github.com/ToddG/experimental/tree/master/erlang/wilderness" target="_blank" >how-to-tutorials</a> showing how little I understand about Erlang</li>
<li>wander away as I lose focus and time</li>
<li>repeat.</li>
</ul>
<p>This year, after Joe died, I thought&hellip;I&rsquo;m not getting any younger either. I
decided to take the summer off and really study Erlang.  So far the process
has been:</p>
<ul>
<li>read the <a href="https://github.com/ToddG/experimental/blob/master/erlang/resources/books.md" target="_blank" >same books</a>, but only as references</li>
<li>have a real problem to solve (I&rsquo;m basing a business on it)</li>
<li>write little code snippets (escripts) to POC business components</li>
<li>document what I am learning on my <a href="http://zwrob.com/posts" target="_blank" >personal website</a></li>
<li>design the full scale app</li>
<li>implement &hellip; oops hitting the road blocks&hellip;</li>
</ul>
<h2 id="road-blocks">Road blocks<a href="#road-blocks" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="erlang-installation-and-tools">Erlang installation and tools<a href="#erlang-installation-and-tools" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>I wish I&rsquo;d known about <a href="https://github.com/asdf-vm/asdf" target="_blank" >asdf</a> much earlier. That&rsquo;s really simplified my dev box
configuration.  I wish that <a href="https://www.rebar3.org" target="_blank" >rebar3</a> and <a href="https://github.com/kerl/kerl" target="_blank" >kerl</a> and other docs just pointed this
out.  In fact, I wish there was a <code>golden</code> path published that just says, look,
here&rsquo;s the common accepted tool chain you are going to want to use. Stay on
this path, and life will be easy. <a href="https://www.rebar3.org" target="_blank" >rebar3</a> is a big part of this story, but
not the whole thing.</p>
<h3 id="migrating-from-escripts-to-real-apps">Migrating from escripts to <code>real</code> apps<a href="#migrating-from-escripts-to-real-apps" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<pre><code>$ rebar3 new escript myfooscript
</code></pre>
<p>I started with escripts because I didn&rsquo;t want the hassle of understanding OTP
or anything else as I was writing POC snippets to understand the basic Erlang
libraries. So I&rsquo;d write an escript to shell out and curl some resource and
gradually build up an application that ingests data and writes into a database,
blah blah. But along the way I could learn about <code>xmerl</code> and other useful
libraries. Oh, and I could run the app and see STDOUT. Cool! Just like any
other language I&rsquo;m familiar with.</p>
<p>So I roll up my sleeves and decide to create an app&hellip;</p>
<h3 id="naming-things-is-hard">Naming things is hard<a href="#naming-things-is-hard" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<pre><code>$ rebar3 new release|umbrella myfooapp
</code></pre>
<p>Um, why does &lsquo;umbrella&rsquo; exist as an option here? Is it the same thing as a
&lsquo;release&rsquo;? Is it necessary? Why is &lsquo;release&rsquo; called &lsquo;release&rsquo;? This is an
overloaded term, as there are &lsquo;releases&rsquo; which is a thing, and there&rsquo;s a
&lsquo;release&rsquo; command, and there&rsquo;s a &lsquo;release&rsquo; target in the rebar3 command. And
there&rsquo;s an &lsquo;umbrella&rsquo; in there, too. OK, release == umbrella, so I pick one.</p>
<pre><code>$ rebar3 new release myfooapp
</code></pre>
<h3 id="where-is-stdout">Where is STDOUT?<a href="#where-is-stdout" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>So, let me say, <code>rebar3</code> is great. I barely remember what it was like to use
<code>sinan</code> or <code>faxien</code>. (And while Loic&rsquo;s Makefiles look amazing, I&rsquo;m nowhere near
smart enough to use them.) But here&rsquo;s the thing, I had to watch a number of videos
before I found out what the <code>shell</code> command was. This is important to me because
the next block I had was&hellip; how do I start my application <em>and</em> see the output
from it? I want to watch STDOUT, right? I was watching some conference video
when someone mentioned that &lsquo;shell&rsquo; was the coolest part of rebar3 and I&rsquo;m
like, &lsquo;what is that&rsquo;? And voila! It&rsquo;s what I needed.</p>
<p>This should be on the golden path.</p>
<pre><code>$ cd myfooapp
$ rebar3 shell myfooapp
</code></pre>
<h3 id="where-is-the-golden-path">Where is the golden path?<a href="#where-is-the-golden-path" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>It&rsquo;s weird that there is no golden path. <a href="https://youtu.be/Z28SDd9bXcE?t=1260" target="_blank" >In this talk</a>, at 14:50, Fred talks
about how it&rsquo;s only far into various Erlang books that authors start talking
about running code outside the shell, in contrast to K&amp;R C where it&rsquo;s discussed
on page 6. In fact, the entire (excellent) presentation is on the terrible state
of tooling in the Erlang ecosystem.</p>
<p><em>begin rant</em></p>
<h4 id="heres-whats-weird-about-erlang--books-are-out-of-date">Here&rsquo;s what&rsquo;s weird about Erlang : Books are out of date<a href="#heres-whats-weird-about-erlang--books-are-out-of-date" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>The books are already out of date. Even <a href="https://learnyousomeerlang.com/" target="_blank" >LYSEFGG</a> still talks about
<a href="http://erlang.org/doc/man/systools.html" target="_blank" >systools</a> and <a href="http://erlang.org/doc/man/reltool.html" target="_blank" >reltool</a> even though <a href="https://www.rebar3.org" target="_blank" >rebar3</a> and <a href="https://github.com/erlware/relx" target="_blank" >relx</a> have
supplanted them?  What&rsquo;s weird about this is to be reading the rebar3
documentation, then cross-referencing with relx, and reading the various books
that describe the old ways of building releases and relups, etc.</li>
</ul>
<h4 id="docs-are-hard-to-follow">Docs are hard to follow<a href="#docs-are-hard-to-follow" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li><a href="https://github.com/erlware/relx" target="_blank" >relx</a> documentation is pretty hard to follow</li>
<li>Community support seems fragmented
<ul>
<li><a href="https://github.com/erlware/relx" target="_blank" >Github shows relx</a> has 41 open issues and 6 open pull requests, with
89 contributors</li>
<li><a href="https://github.com/erlang/rebar3" target="_blank" >Github shows rebar3</a> has 107 open issues and 11 open pull requests,
with 239 contributors</li>
</ul>
</li>
</ul>
<h4 id="whos-maintaining-these-tools">Who&rsquo;s maintaining these tools?<a href="#whos-maintaining-these-tools" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>If I were Tristan or Fred, boy I&rsquo;d be tired of supporting this stuff.</p>
<h4 id="where-are-the-videos">Where are the videos?<a href="#where-are-the-videos" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>Here&rsquo;s another thing that&rsquo;s weird&hellip;</p>
<p>I cannot find videos on how to use the Erlang shell. So on top of that weird
fact, I&rsquo;m finding out about erlang by watching Elixir videos. I was watching an
Elixir video on &lsquo;wobserver&rsquo; and realized, &lsquo;Hey! I bet that&rsquo;s just a web
interface on some Erlang thingy called &ldquo;observer&rdquo;&rsquo;.  So then I find out about
&lsquo;observer&rsquo; and how useful that is. Great!  But things like, how to I do basic
stuff like navigate from one process to another, what do I do when everything
seems hung and broken, what do real live seasoned Erlang devs do when &lsquo;<em>stuff</em>
hit&rsquo;s the fan&rsquo;? How do they go about examining a running system? The web seems
to have nothing on this. But that&rsquo;s just weird, b/c Erlang has been around for
over 25 years, and any other language / framework/ runtime whatever has zillions
of youtube videos.</p>
<p><em>end rant</em></p>
<h2 id="culture-of-quick-fixes">Culture of Quick Fixes<a href="#culture-of-quick-fixes" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>OK, so enough ranting. Let me get into <a href="https://youtu.be/Z28SDd9bXcE?t=1260" target="_blank" >Fred&rsquo;s mention of the &lsquo;Culture of Quick
Fixes&rsquo;</a> (at about 21:00) by introducing my own steaming pile of a quick fix.</p>
<p>So here&rsquo;s the deal. I&rsquo;m trying to build a <a href="http://envirosoftwaresolutions.com" target="_blank" >company</a>. I have limited $$$, I
can&rsquo;t screw around learning stuff forever. At some point I have to build a real
live app and try to generate some buzz. I&rsquo;ll roughly describe my first
app/service and run through my decision points&hellip;</p>
<h3 id="app">App<a href="#app" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>The app basically pulls data from publicly available but disparate data sets,
ingests them, normalizes them into a common data store, and then surfaces the
data store for analysis, reporting, AI/ML, etc, etc. In a nutshell, take data,
add magic, produce pretty pictures.</p>
<h3 id="process">Process<a href="#process" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>prototype in bash (or python, or whatever&hellip;)</li>
</ul>
<p>Seriously, with just <code>bash</code> and I can query for my data, extract in, play
around with it, etc. If I wanted I could hook it up to <code>cron</code> and probably move on
to actually using the data rather than learning Erlang and how to build &lsquo;proper&rsquo;
infrastructure.</p>
<h3 id="prototype-in-escript">Prototype in escript<a href="#prototype-in-escript" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Here&rsquo;s where I take small tasks and learn the Erlang libraries to accomplish
what I&rsquo;m trying to do. It takes about as much time to do this as the previous
prototyping step. I find this to be a great way to both decompose a problem and
learn a new language.</p>
<h3 id="start-building-industrial-grade-services">Start building industrial grade services<a href="#start-building-industrial-grade-services" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>So now, rather than focusing on my business, finding customers, analyzing the
data I&rsquo;ve collected, or in any other way providing value that could bring in
revenue and allow me to purchase more Erlang books&hellip; I&rsquo;m veering off into the
weeds and learning how to:</p>
<ul>
<li>build erlang apps for real</li>
<li>build erlang releases</li>
<li>wire all this into docker containers</li>
<li>wire in monitoring and all the &lsquo;industrial grade goodies&rsquo;</li>
</ul>
<p>Along the way I tend to post about what I learn <a href="http://zwrob.com/posts" target="_blank" >here</a>.</p>
<ul>
<li>Is any of this worthwhile?</li>
<li>Am I just engaged in endless pencil sharpening?</li>
<li>I dunno. I&rsquo;m too close to the fire.</li>
</ul>
<p>I&rsquo;m having fun though. And it&rsquo;s incredibly useful to my brain in some way I cannot describe.</p>
<h3 id="the-problem">The Problem<a href="#the-problem" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>So back to &ldquo;The Culture of Quick Fixes&rdquo;. As I&rsquo;m building my first set of
components and learning about rebar.config and config/sys.config and more groovy
stuff, I run into the issue of how to deploy Erlang to docker containers. The
answer is, run the release with the <code>foreground</code> command. But this wasn&rsquo;t
obvious to me at first and took a lot of digging around the &rsquo;net, <a href="https://www.rebar3.org/discuss/5d29172873e1ed00447cb362" target="_blank" >posting a
question on the rebar3 discussion list</a>, and just general noodling around.</p>
<p>But, if I&rsquo;m building industrial grade applications, then I need to solve for
issues such as:</p>
<ul>
<li>How do I emit metrics from my app?</li>
<li>How do I monitor my metrics (e.g. Prometheus)?</li>
<li>How do I hook up a visualization tool (e.g. Grafana)? Alarms?</li>
<li>And how do I wire all this up into a containerized solution so that it&rsquo;s
re-usable and shareable?</li>
<li>Don&rsquo;t forget my &ldquo;awesome&rdquo; Makefiles! I like to have a common control plane for
all my services, and common Makefiles are great for this.</li>
</ul>
<p>Now, if you watched the end of Fred&rsquo;s video, he was talking about many of these
same things.</p>
<p><em>And I&rsquo;ll suggest that what I&rsquo;ve built is an example of exactly what
shouldn&rsquo;t be done:</em></p>
<ul>
<li>I ignored everything on hex. Why? Um, I don&rsquo;t really understand hex that well
yet, I&rsquo;d have to go read a bunch of code to understand what folks have done,
and I&rsquo;m still learning Erlang by building things myself. None of these is a
good reason, BTW.</li>
<li>I only published my stuff to github, and not to hex. This may be a good thing
as I&rsquo;d just be duplicating other, probably better, efforts.</li>
<li>What I built should probably be a rebar3 plugin, and not a Makefile with
dependencies on rebar3 etc.</li>
</ul>
<p>However, I&rsquo;ll show you what this is because I think it satisfies a need and
perhaps we can all come up with a better implementation strategy. Or learn
something.</p>
<h2 id="erlang-seed">Erlang-Seed<a href="#erlang-seed" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>So, here we have &lsquo;yet-another-quick-fix&rsquo; called <a href="https://github.com/ToddG/erlang-seed" target="_blank" >erlang-seed</a>. Let me be
honest, this is a &lsquo;quick-fix&rsquo; to satisfy my own personal needs&hellip;</p>
<h3 id="the-good">The Good<a href="#the-good" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>What this does is create an erlang application, inject it into a Docker
container, and then spin up a local Docker cluster that monitors the Erlang app
and surfaces the metrics via Prometheus and Grafana. So with one command I can
generate an OTP application, all the infrastructure necessary to monitor it with
common tooling, <em>and</em> spin it up and run it on my dev box. I find this to be
really useful. YMMV.</p>
<h3 id="the-bad">The Bad<a href="#the-bad" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>This is really crufty. It calls into rebar3 to generate the app. It should
probably be a rebar3 plugin so that it can better evolve with the tooling. It
could then more intelligently inject the necessary dependencies, instrument the
code with metrics, etc. Right now it&rsquo;s gross, as it just overwrites files as
necessary using mustache templates.</p>
<h3 id="the-ugly">The Ugly<a href="#the-ugly" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>Do I have time to maintain this? No.</li>
<li>Do I have time to make this a rebar3 plugin? Not right now.</li>
<li>Will this probably break over time due to either rebar3, docker, or some other dependency changing? Certainly, eventually, yes.</li>
</ul>
<h2 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>The reason I&rsquo;m sharing this is to just widen the discussion on what the Erlang
education and tooling could look like. I think that generating full stacks that
allow developers to focus more on solving business domain issues rather than
forcing them to understand all the arcane details of whatever is under the
covers is the &lsquo;way to go (TM)&rsquo;. There&rsquo;s got to be a way to allow developers to
maintain velocity while increasing their depth and scope of knowledge as
necessary. I&rsquo;ve been studying Erlang intensely for at least a month now, read
the books <em>countless</em> times, and read the online docs and I still don&rsquo;t quite
understand how this all fits together. I mean I get the big picture. But there&rsquo;s
a <em>lot</em> of details.</p>
<p>Contrast this with Go. I was writing production code in 2 days. The quality was
production quality after about a week. Back in the day it took me about a month
to become proficient in Java, though it required reading Bloch&rsquo;s book &ldquo;Java
Concurrency In Practice&rdquo; to be &lsquo;good&rsquo;. Python was similar, it took about a week
to ramp up, about a month to become comfortable. In all of these languages it
was a relatively short and easy ramp up and then smooth sailing for years and
years.</p>
<p>With Erlang it&rsquo;s an incredibly steep ramp that goes on and on. I guess if I
remember that I&rsquo;m learning the equivalent of a language, an orchestration
framework (like kubernetes), a database system, etc., then it starts to make
sense.</p>
<p>Anyway, for my part, I&rsquo;ll keep posting things as I figure them out.</p>
<p>-Todd</p>
]]></content>
		</item>
		
		<item>
			<title>Monitoring : Part 4</title>
			<link>https://zwrob.com/en/posts/monitoring-04/</link>
			<pubDate>Mon, 01 Jul 2019 12:27:46 -0700</pubDate><guid>https://zwrob.com/en/posts/monitoring-04/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>In the previous post, <a href="../monitoring-03/" >Monitoring : Part 3</a> we created some basic Prometheus metrics using Erlang. In this post we&rsquo;ll explore those metrics in Grafana to get a feel for how Grafana works.</p>
<h2 id="launch-metrics">Launch Metrics<a href="#launch-metrics" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>mkdir temp
</span></span><span style="display:flex;"><span>cd temp
</span></span><span style="display:flex;"><span>git clone https://github.com/toddg/emitter
</span></span></code></pre></div><p>Start the docker components.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cd emitter
</span></span><span style="display:flex;"><span>make start
</span></span></code></pre></div><p>Wait a second and run <code>docker ps</code> to verify the containers started and stayed started:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ docker ps
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                    NAMES
</span></span><span style="display:flex;"><span>506443c4d497        toddg/erlang-wavegen      <span style="color:#e6db74">&#34;/bin/bash -l -c /bu…&#34;</span>   <span style="color:#ae81ff">12</span> seconds ago      Up <span style="color:#ae81ff">8</span> seconds        0.0.0.0:4444-&gt;4444/tcp   monitor_wavegen_1
</span></span><span style="display:flex;"><span>b6b7cc6e0128        grafana/grafana:6.2.4     <span style="color:#e6db74">&#34;/run.sh&#34;</span>                <span style="color:#ae81ff">12</span> seconds ago      Up <span style="color:#ae81ff">7</span> seconds        0.0.0.0:3000-&gt;3000/tcp   monitor_grafana_1
</span></span><span style="display:flex;"><span>f8cef82f727e        prom/prometheus:v2.10.0   <span style="color:#e6db74">&#34;/bin/prometheus --c…&#34;</span>   <span style="color:#ae81ff">12</span> seconds ago      Up <span style="color:#ae81ff">6</span> seconds        0.0.0.0:9090-&gt;9090/tcp   monitor_prometheus_1
</span></span></code></pre></div><h2 id="interesting-urls">Interesting URLs<a href="#interesting-urls" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="wavegen">wavegen<a href="#wavegen" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> curl http://localhost:4444/metrics | grep my | head
</span></span><span style="display:flex;"><span>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
</span></span><span style="display:flex;"><span>                                 Dload  Upload   Total   Spent    Left  Speed
</span></span><span style="display:flex;"><span>100 94392  100 94392    0     0   970k      0 --:--:-- --:--:-- --:--:--  970k
</span></span><span style="display:flex;"><span># TYPE mycounter counter
</span></span><span style="display:flex;"><span># HELP mycounter count the times each method has been invoked
</span></span><span style="display:flex;"><span>mycounter{method=&#34;flatline&#34;} 11295
</span></span><span style="display:flex;"><span>mycounter{method=&#34;flipflop&#34;} 11295
</span></span><span style="display:flex;"><span>mycounter{method=&#34;incrementer&#34;} 11295
</span></span><span style="display:flex;"><span>mycounter{method=&#34;sinewave&#34;} 11295
</span></span><span style="display:flex;"><span># TYPE myguage gauge
</span></span><span style="display:flex;"><span># HELP myguage current value of a method
</span></span><span style="display:flex;"><span>myguage{method=&#34;flipflop&#34;} 1
</span></span><span style="display:flex;"><span>myguage{method=&#34;incrementer&#34;} 11295
</span></span></code></pre></div><h3 id="prometheus">Prometheus<a href="#prometheus" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Cool, we see the same metrics that we were printing out in the previous post. Now
let&rsquo;s verify that the prometheus server can scrape this data from <code>wavegen</code>:</p>
<p>Browse to: http://localhost:9090/targets</p>
<p>You should see both <code>prometheus</code> and <code>wavegen</code> up with a last scrape in the 5-10 second range like here:</p>
<p><img src="/assets/prometheus-targets.png" alt="Prometheus Targets" title="Prometheus Targets"></p>
<h3 id="grafana">Grafana<a href="#grafana" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Browse to: http://localhost:3000/login</p>
<p><img src="/assets/grafana-login.png" alt="Grafana Login" title="Grafana Login"></p>
<ul>
<li>Enter: admin/admin</li>
<li>Skip changing the password</li>
</ul>
<p><img src="/assets/grafana-home.png" alt="Grafana Home" title="Grafana Home"></p>
<ul>
<li>From here, select HOME</li>
</ul>
<p><img src="/assets/grafana-home-dashboard.png" alt="Grafana Dashboard Home" title="Grafana Dashboard Home"></p>
<ul>
<li>Select BEAM</li>
</ul>
<p><img src="/assets/grafana-select-dashboard.png" alt="Grafana Home" title="Grafana Select Dashboard"></p>
<ul>
<li>Select PlayingWithWaveGenMetrics</li>
</ul>
<p><img src="/assets/grafana-wavegen-dashboard.png" alt="Grafana Wavgen Dashboard" title="Grafana Wavegen Dashboard"></p>
<ul>
<li>We have arrived at the PlayingWithWaveGenMetrics dashboard.</li>
</ul>
<h3 id="how-prometheus-works">How Prometheus Works<a href="#how-prometheus-works" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<h4 id="scrape-interval">Scrape Interval<a href="#scrape-interval" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p>The first thing to understand is the <code>scrape_interval</code>. This is the frequency at which
Prometheus will query the targets for their metrics. <code>scrape_interval</code> is configured in
the <code>prometheus.yml</code> like this:</p>
<p>prometheus.yml</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">global</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">scrape_interval</span>: <span style="color:#ae81ff">XXs    </span> <span style="color:#75715e"># X seconds</span>
</span></span></code></pre></div><p>Remember that metrics emitters do not normally include timestamps in their data. So
when Prometheus queries the <code>wavegen</code> emitter, this is what that looks like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>mycounter{method=&#34;countup&#34;} 25522
</span></span><span style="display:flex;"><span>mycounter{method=&#34;flatline&#34;} 25522
</span></span><span style="display:flex;"><span>mycounter{method=&#34;flipflop&#34;} 25522
</span></span><span style="display:flex;"><span>mycounter{method=&#34;incrementer&#34;} 25522
</span></span><span style="display:flex;"><span>mycounter{method=&#34;sinewave&#34;} 25522
</span></span><span style="display:flex;"><span>myguage{method=&#34;flipflop&#34;} -1
</span></span><span style="display:flex;"><span>...
</span></span></code></pre></div><p>Note that there are no timestamps in this data. This means that Prometheus must be
timestamping this data at scrape time. Why is this important you ask? Well, because
if you are looking at something like <code>changes()</code> below:</p>
<p><a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#changes" target="_blank" >https://prometheus.io/docs/prometheus/latest/querying/functions/#changes</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>changes()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>For each input time series, changes(v range-vector) returns the number of times
</span></span><span style="display:flex;"><span>its value has changed within the provided time range as an instant vector.  
</span></span></code></pre></div><p>So the question is, does this mean every time a counter is incremented we get some <code>changes()</code>
value incremented? No, for several reasons. First, the counters like <code>mycounter</code> above are
always increasing. But this counter could increase from say, 1 to 100 in one step, or in 99 steps.
We have no way of knowing b/c the emitter is not keeping track of mutations, it&rsquo;s keeping track
of a current value. So when the Prometheus scraper queries <code>wavegen:4444/metrics</code> and grabs the
metrics, it&rsquo;s grabbing a set of current values, timestamping them, and stuffing them into a
time series database.</p>
<p>Let&rsquo;s get back to a real world example. If we have a counter that is monotonically increasing by
<code>1</code> every second, what will <code>changes()</code> show? It completely depends on the scrape_interval:</p>
<p>We&rsquo;ll use the following <code>promql</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-promql" data-lang="promql"><span style="display:flex;"><span><span style="color:#66d9ef">changes</span><span style="color:#f92672">(</span>myguage{method<span style="color:#f92672">=~</span>&#34;<span style="color:#e6db74">incrementer</span>&#34;}[<span style="color:#960050;background-color:#1e0010">XXs</span>]<span style="color:#f92672">)</span>
</span></span></code></pre></div><h2 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="the-point-of-this-entire-post">The point of this entire post<a href="#the-point-of-this-entire-post" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Here we have a graph of the <code>incrementer()</code> function where the <code>scraper_interval</code> was set to 05s:</p>
<p><img src="/assets/incrementer-changes-05s-interval.png" alt="Incrementer Changes at 05s Scraper Interval" title="Incrementer Changes at 05s Scraper Interval"></p>
<p>Here we have a graph of the <code>incrementer()</code> function where the <code>scraper_interval</code> was set to 15s:
<img src="/assets/incrementer-changes-15s-interval.png" alt="Incrementer Changes at 15s Scraper Interval" title="Incrementer Changes at 15s Scraper Interval"></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>                            changes
</span></span><span style="display:flex;"><span>scrape_interval         10s               20s          30s             60s
</span></span><span style="display:flex;"><span>--------------------|--------------|-------------|--------------|-------------|
</span></span><span style="display:flex;"><span>15s                     0               0               1               3
</span></span><span style="display:flex;"><span>05s                     1               3               5              11
</span></span></code></pre></div><p><strong>The results show that it doesn&rsquo;t matter how many times a value changes in between scrapes,
what <code>changes()</code> is counting is the number of <code>scrapes</code> that have changed values.</strong> This means
that if you have 1 scrape and the value changed, then <code>changes()</code> will show 1. If there are
100 scrapes and the value has changed 50 times, then <code>changes()</code> will show 50. This is such a
simple concept&hellip;but the docs made this clear as mud for me and it took a morning of experimentation
to determine how this worked.</p>
<p>The next post discusses Erlang and how to actually wire metrics infrastucture into Erlang
applications: <a href="../erlang-01/" >Erlang : Where is the Golden Path</a>.</p>
]]></content>
		</item>
		
		<item>
			<title>Monitoring : Part 3</title>
			<link>https://zwrob.com/en/posts/monitoring-03/</link>
			<pubDate>Mon, 01 Jul 2019 07:56:19 -0700</pubDate><guid>https://zwrob.com/en/posts/monitoring-03/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>In the previous post, <a href="../monitoring-02/" >Monitoring : Part 2</a> we looked at how Linux exposes host metrics and in particular how the Prometheus agent, called <code>node_exporter</code>, reads the Linux host metrics. In this post we&rsquo;re going to circle back to the <a href="https://github.com/toddg/monitor" target="_blank" >monitor</a> project mentioned in <a href="../monitoring-01/" >Monitoring : Part 1</a>, and add some basic Prometheus metrics, using Erlang, so that we can explore them in Grafana.</p>
<h2 id="dependencies">Dependencies<a href="#dependencies" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>You need to have the following installed to make use of the demo:</p>
<ul>
<li>git</li>
<li>docker</li>
<li>docker-compose</li>
<li>make</li>
</ul>
<h2 id="getting-started">Getting Started<a href="#getting-started" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Clone the <code>monitor</code> repo.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>mkdir temp
</span></span><span style="display:flex;"><span>cd temp
</span></span><span style="display:flex;"><span>git clone https://github.com/toddg/emitter
</span></span></code></pre></div><p>Start the docker components.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cd emitter
</span></span><span style="display:flex;"><span>make start
</span></span></code></pre></div><p>Verify everything started OK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps
</span></span></code></pre></div><p>You should see the following components running:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                    NAMES
</span></span><span style="display:flex;"><span>02dc8ccb5218        toddg/erlang-wavegen      <span style="color:#e6db74">&#34;/bin/bash -l -c /bu…&#34;</span>   <span style="color:#ae81ff">18</span> hours ago        Up <span style="color:#ae81ff">18</span> hours         0.0.0.0:4444-&gt;4444/tcp   monitor_wavegen_1
</span></span><span style="display:flex;"><span>d8bb17caa1d0        grafana/grafana:6.2.4     <span style="color:#e6db74">&#34;/run.sh&#34;</span>                <span style="color:#ae81ff">18</span> hours ago        Up <span style="color:#ae81ff">18</span> hours         0.0.0.0:3000-&gt;3000/tcp   monitor_grafana_1
</span></span><span style="display:flex;"><span>1715763b4326        prom/prometheus:v2.10.0   <span style="color:#e6db74">&#34;/bin/prometheus --c…&#34;</span>   <span style="color:#ae81ff">18</span> hours ago        Up <span style="color:#ae81ff">18</span> hours         0.0.0.0:9090-&gt;9090/tcp   monitor_prometheus_1
</span></span></code></pre></div><h2 id="emit-metrics">Emit Metrics<a href="#emit-metrics" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>It&rsquo;s trivial to write a metrics emitter in Erlang. Here&rsquo;s why, the <code>receive ... after</code> pattern for responding to messages. The snippet below is a simple timer function that invokes a method <code>F</code> on a data blob <code>D</code> if no message is received after <code>Delay</code> milliseconds:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% timer calls itself every Delay milliseconds and invokes function F on 
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% Data D
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">timer</span>(Delay, F, D) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">receive</span> cancel  <span style="color:#f92672">-&gt;</span> 
</span></span><span style="display:flex;"><span>                void
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">after</span> Delay     <span style="color:#f92672">-&gt;</span> 
</span></span><span style="display:flex;"><span>              D1 <span style="color:#f92672">=</span> F(D),
</span></span><span style="display:flex;"><span>              timer(Delay, F, D1)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">end</span>.
</span></span></code></pre></div><p>The helper <code>timer</code> function above is invoked by another helper function <code>tick</code>. <code>tick</code> spawns an Erlang process using <code>timer</code>. The <code>timer</code> method in the spawned process waits for an event that never comes, times out, and invokes the function <code>F</code> in the<code>after</code> stanza. Here&rsquo;s <code>tick</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% tick calls itself every N milliseconds and invokes function F on 
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% Data D; returns a cancel function C
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">tick</span>(N, F, D) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    Pid <span style="color:#f92672">=</span> spawn(<span style="color:#66d9ef">fun</span>() <span style="color:#f92672">-&gt;</span> timer(N, F, D) <span style="color:#66d9ef">end</span>),
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">fun</span>() <span style="color:#f92672">-&gt;</span> Pid <span style="color:#f92672">!</span> cancel <span style="color:#66d9ef">end</span>.
</span></span></code></pre></div><p>Now that we can invoke methods via a timer, let&rsquo;s wire in some methods to emit Prometheus metrics. First, we add a helper function to emit data from the various emitter functions. To start with, let&rsquo;s verify that the timer works, by printing to STDOUT:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% emit : side-effect for the function F
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">emit</span>(Name, Value) <span style="color:#f92672">-&gt;</span> 
</span></span><span style="display:flex;"><span>    io:<span style="color:#a6e22e">format</span>(<span style="color:#e6db74">&#34;emit: [</span><span style="color:#e6db74">~p</span><span style="color:#e6db74">]</span><span style="color:#e6db74">~p~n</span><span style="color:#e6db74">&#34;</span>, [Name, Value]).
</span></span></code></pre></div><p>Let&rsquo;s wire the <code>emit</code> function into the following functions that actually do something:</p>
<ul>
<li>flatline</li>
<li>incrementer</li>
<li>flipflop</li>
<li>sinewave</li>
</ul>
<p>Here&rsquo;s what these methods look like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% flat line : emits the value 1 for a flat line shape
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">flatline</span>(_) <span style="color:#f92672">-&gt;</span> emit(<span style="color:#e6db74">&#34;flatline&#34;</span>, <span style="color:#ae81ff">1</span>), ok.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% incrementer : always increments value
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">incrementer</span>(V) <span style="color:#f92672">-&gt;</span> 
</span></span><span style="display:flex;"><span>    V1 <span style="color:#f92672">=</span> V <span style="color:#f92672">+</span> <span style="color:#ae81ff">1</span>,
</span></span><span style="display:flex;"><span>    emit(<span style="color:#e6db74">&#34;incrementer&#34;</span>, V1),
</span></span><span style="display:flex;"><span>    V1.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% flip flop : emits the value 1 and then the value 0
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">flipflop</span>(<span style="color:#ae81ff">0</span>) <span style="color:#f92672">-&gt;</span> emit(<span style="color:#e6db74">&#34;flipflop&#34;</span>, <span style="color:#ae81ff">1</span>), <span style="color:#ae81ff">1</span>;
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">flipflop</span>(<span style="color:#ae81ff">1</span>) <span style="color:#f92672">-&gt;</span> emit(<span style="color:#e6db74">&#34;flipflop&#34;</span>, <span style="color:#ae81ff">0</span>), <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">flipflop</span>(_) <span style="color:#f92672">-&gt;</span> emit(<span style="color:#e6db74">&#34;flipflop&#34;</span>, <span style="color:#ae81ff">0</span>), <span style="color:#ae81ff">0</span>.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% sine wave
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">sinewave</span>(V) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    sinewave(V, <span style="color:#ae81ff">1</span>).
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">sinewave</span>(V, Delta) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    emit(<span style="color:#e6db74">&#34;sinewave&#34;</span>, math:<span style="color:#a6e22e">sin</span>(V)),
</span></span><span style="display:flex;"><span>    V1 <span style="color:#f92672">=</span> V <span style="color:#f92672">+</span> Delta,
</span></span><span style="display:flex;"><span>    V1.
</span></span></code></pre></div><p>The last step is start these emitter methods in main:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%====================================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% API functions
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%====================================================================
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">%% escript Entry point
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">main</span>(Args) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    io:<span style="color:#a6e22e">format</span>(<span style="color:#e6db74">&#34;Args: </span><span style="color:#e6db74">~p~n</span><span style="color:#e6db74">&#34;</span>, [Args]),
</span></span><span style="display:flex;"><span>    CancelFuns <span style="color:#f92672">=</span> [tick(<span style="color:#ae81ff">10</span>, F, <span style="color:#ae81ff">0</span>) || F <span style="color:#f92672">&lt;-</span> [<span style="color:#66d9ef">fun</span> flatline<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> flipflop<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> sinewave<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> incrementer<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>]],
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">%% this never get&#39;s called
</span></span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">receive</span>
</span></span><span style="display:flex;"><span>        {ok} <span style="color:#f92672">-&gt;</span> ok
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">end</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">%% cancel all the timers
</span></span></span><span style="display:flex;"><span>    [F() || F <span style="color:#f92672">&lt;-</span> CancelFuns],
</span></span><span style="display:flex;"><span>    erlang:<span style="color:#a6e22e">halt</span>(<span style="color:#ae81ff">0</span>).
</span></span></code></pre></div><p>One of the beauties of Erlang is list comprehensions. Here, we map the <code>tick</code> function across the list of emitter funcitons, thereby spawning an Erlang process for each of them:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span>    CancelFuns <span style="color:#f92672">=</span> [tick(<span style="color:#ae81ff">10</span>, F, <span style="color:#ae81ff">0</span>) || F <span style="color:#f92672">&lt;-</span> [<span style="color:#66d9ef">fun</span> flatline<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> flipflop<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> sinewave<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">fun</span> incrementer<span style="color:#f92672">/</span><span style="color:#ae81ff">1</span>]],
</span></span></code></pre></div><p>Let&rsquo;s run this and see what the output looks like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>make start
</span></span><span style="display:flex;"><span>cd monitor <span style="color:#f92672">&amp;&amp;</span> docker-compose logs -f --tail<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;all&#34;</span> | grep wavegen
</span></span></code></pre></div><p>The first line invokes the <code>start</code> task in the <code>Makefile</code> which invokes the <code>docker-compose up</code>.
The second line tails the output of the <code>wavegen</code> container:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>wavegen_1     | emit: [&#34;sinewave&#34;]-0.7391806966492228
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;incrementer&#34;]63
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flatline&#34;]1
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flipflop&#34;]0
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;sinewave&#34;]0.16735570030280691
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;incrementer&#34;]64
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flatline&#34;]1
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flipflop&#34;]1
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;sinewave&#34;]0.9200260381967906
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;incrementer&#34;]65
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flatline&#34;]1
</span></span><span style="display:flex;"><span>wavegen_1     | emit: [&#34;flipflop&#34;]0
</span></span></code></pre></div><p>The key takeaways are:</p>
<ul>
<li>flatline always emits : 1</li>
<li>flipflop alternates between 0 and 1</li>
<li>incrementer is monotonically increasing by 1</li>
<li>sinewave is taking the <code>sin()</code> of a number that is increasing by 1 every step</li>
</ul>
<p>Now that we have verified that he <code>emit</code> function is getting called repeatedly, let&rsquo;s wire in the prometheus metrics by replacing the print statement with a function to emit metrics:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% emit : side-effect for the function F
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">emit</span>(Name, Value) <span style="color:#f92672">-&gt;</span> 
</span></span><span style="display:flex;"><span>    multimetric(Name, Value).
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% multimetric : emit all the metrics since we&#39;re just trying to
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% sort out how all this works. this way we can see stuff in the
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%% grafana dashboard
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">%%--------------------------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">multimetric</span>(Label, Value) <span style="color:#f92672">-&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">%% counter for times the method has been invoked
</span></span></span><span style="display:flex;"><span>    prometheus_counter:<span style="color:#a6e22e">inc</span>(mycounter, [Label], <span style="color:#ae81ff">1</span>),
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">% set a gauge to the current value
</span></span></span><span style="display:flex;"><span>    prometheus_gauge:<span style="color:#a6e22e">set</span>(myguage, [Label], Value),
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">% set the summary to the current value
</span></span></span><span style="display:flex;"><span>    prometheus_summary:<span style="color:#a6e22e">observe</span>(mysummary, [Label], Value),
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">% set the histogram to the current value
</span></span></span><span style="display:flex;"><span>    prometheus_histogram:<span style="color:#a6e22e">observe</span>(myhist, [Label], Value).
</span></span></code></pre></div><p>Of course the metrics have to be registered, and the proper services started, etc. See the <a href="https://github.com/ToddG/emitter/blob/master/wavegen/src/wavegen.erl" target="_blank" >source</a> for further details.</p>
<h2 id="grafana">Grafana<a href="#grafana" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Now that we are emitting known metrics, let&rsquo;s see what they look like in Grafana, coming up in the next post: <a href="../monitoring-04/" >Monitoring : Part 4</a>.</p>
]]></content>
		</item>
		
		<item>
			<title>Linux Procfs</title>
			<link>https://zwrob.com/en/posts/linux-procfs/</link>
			<pubDate>Fri, 28 Jun 2019 11:03:12 -0700</pubDate><guid>https://zwrob.com/en/posts/linux-procfs/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>What is procfs (and sysfs) and what are they used for?</p>
<h2 id="overview">Overview<a href="#overview" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>There&rsquo;s a <em>ton</em> of information out there, but here&rsquo;s what you need to know:</p>
<p>From &ldquo;Linux Kernel Procfs Guide&rdquo; by Erik (J.A.K.) Mouw&hellip;
<a href="https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile&amp;do=get&amp;target=procfs-guide_2.6.29.pdf" target="_blank" >https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile&do=get&target=procfs-guide_2.6.29.pdf</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>The /proc file system (procfs) is a special file system in the linux kernel.
</span></span><span style="display:flex;"><span>It’s a virtual file system: it is not associated with a block device but exists
</span></span><span style="display:flex;"><span>only in memory. The files in the procfs are there to allow userland programs
</span></span><span style="display:flex;"><span>access to certain information from the kernel (like process information in
</span></span><span style="display:flex;"><span>/proc/[0-9]+/ ), but also for debug purposes (like /proc/ksyms ).  
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>...  
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Instead of reading (or writing) information directly from kernel memory, procfs
</span></span><span style="display:flex;"><span>works with call back functions for files: functions that are called when a
</span></span><span style="display:flex;"><span>specific file is being read or written.  
</span></span></code></pre></div><p>More links:</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Procfs" target="_blank" >Overview</a></li>
<li><a href="https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile&amp;do=get&amp;target=procfs-guide_2.6.29.pdf" target="_blank" >Deep dive</a></li>
<li><a href="https://unix.stackexchange.com/questions/4884/what-is-the-difference-between-procfs-and-sysfs" target="_blank" >Commentary</a></li>
</ul>
<p>So basically, procfs and sysfs allow us access to kernel level details via a file-system-like API. <a href="http://lucasvr.gobolinux.org/etc/Killian84-Procfs-USENIX.pdf" target="_blank" >Everything is a file</a>.</p>
<h2 id="documentation">Documentation<a href="#documentation" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>There is this magical kindom called Kernel.org, and in that kingdom, they have documentation&hellip;</p>
<p><a href="https://www.kernel.org/doc/Documentation/filesystems/proc.txt" target="_blank" >https://www.kernel.org/doc/Documentation/filesystems/proc.txt</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>                       T H E  /proc   F I L E S Y S T E M
</span></span><span style="display:flex;"><span>------------------------------------------------------------------------------
</span></span></code></pre></div><p>Kernel.org is a documentation dream. Section 1.8 deals with what we are interested in, <code>/proc/stat</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>  1.8	Miscellaneous kernel statistics in /proc/stat
</span></span></code></pre></div><p>Paging down to that section, we see the nuts and bolts of how this works:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>1.8 Miscellaneous kernel statistics in /proc/stat
</span></span><span style="display:flex;"><span>-------------------------------------------------
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Various pieces   of  information about  kernel activity  are  available in the
</span></span><span style="display:flex;"><span>/proc/stat file.  All  of  the numbers reported  in  this file are  aggregates
</span></span><span style="display:flex;"><span>since the system first booted.  For a quick look, simply cat the file:
</span></span></code></pre></div><p>Ok, let&rsquo;s try it&hellip;</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>&lt;pre&gt;$ cat /proc/stat
</span></span><span style="display:flex;"><span>cpu  <span style="color:#ae81ff">1274240</span> <span style="color:#ae81ff">19928</span> <span style="color:#ae81ff">407422</span> <span style="color:#ae81ff">72766108</span> <span style="color:#ae81ff">72703</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">12494</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu0 <span style="color:#ae81ff">188950</span> <span style="color:#ae81ff">2084</span> <span style="color:#ae81ff">56891</span> <span style="color:#ae81ff">10272145</span> <span style="color:#ae81ff">10833</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">6916</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu1 <span style="color:#ae81ff">125875</span> <span style="color:#ae81ff">1620</span> <span style="color:#ae81ff">39109</span> <span style="color:#ae81ff">8952369</span> <span style="color:#ae81ff">19718</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1321</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu2 <span style="color:#ae81ff">193832</span> <span style="color:#ae81ff">2997</span> <span style="color:#ae81ff">58106</span> <span style="color:#ae81ff">8873354</span> <span style="color:#ae81ff">10000</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">569</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu3 <span style="color:#ae81ff">124766</span> <span style="color:#ae81ff">1828</span> <span style="color:#ae81ff">43418</span> <span style="color:#ae81ff">8964723</span> <span style="color:#ae81ff">5675</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">155</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu4 <span style="color:#ae81ff">194548</span> <span style="color:#ae81ff">2834</span> <span style="color:#ae81ff">58202</span> <span style="color:#ae81ff">8873039</span> <span style="color:#ae81ff">9908</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">130</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu5 <span style="color:#ae81ff">126274</span> <span style="color:#ae81ff">1812</span> <span style="color:#ae81ff">44630</span> <span style="color:#ae81ff">8970546</span> <span style="color:#ae81ff">6717</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">333</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu6 <span style="color:#ae81ff">195927</span> <span style="color:#ae81ff">4164</span> <span style="color:#ae81ff">67449</span> <span style="color:#ae81ff">8882986</span> <span style="color:#ae81ff">5034</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">392</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu7 <span style="color:#ae81ff">124064</span> <span style="color:#ae81ff">2586</span> <span style="color:#ae81ff">39614</span> <span style="color:#ae81ff">8976943</span> <span style="color:#ae81ff">4814</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">2676</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>intr <span style="color:#ae81ff">77943879</span> <span style="color:#ae81ff">6459077</span> <span style="color:#ae81ff">6315</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1</span> <span style="color:#ae81ff">25484</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">829151</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">747</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">16</span> <span style="color:#ae81ff">430</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">43772</span> <span style="color:#ae81ff">6105365</span> <span style="color:#ae81ff">2416471</span> <span style="color:#ae81ff">6126426</span> <span style="color:#ae81ff">3089783</span> <span style="color:#ae81ff">6233849</span> <span style="color:#ae81ff">833826</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">19</span> <span style="color:#ae81ff">1623130</span> <span style="color:#ae81ff">640778</span> <span style="color:#ae81ff">174</span> <span style="color:#ae81ff">385550</span> <span style="color:#ae81ff">841313</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>ctxt <span style="color:#ae81ff">220842322</span>
</span></span><span style="display:flex;"><span>btime <span style="color:#ae81ff">1561498948</span>
</span></span><span style="display:flex;"><span>processes <span style="color:#ae81ff">58050</span>
</span></span><span style="display:flex;"><span>procs_running <span style="color:#ae81ff">2</span>
</span></span><span style="display:flex;"><span>procs_blocked <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>softirq <span style="color:#ae81ff">28105901</span> <span style="color:#ae81ff">2528</span> <span style="color:#ae81ff">9356000</span> <span style="color:#ae81ff">121075</span> <span style="color:#ae81ff">1863721</span> <span style="color:#ae81ff">835876</span> <span style="color:#ae81ff">56</span> <span style="color:#ae81ff">249179</span> <span style="color:#ae81ff">9047058</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">6630408</span>
</span></span></code></pre></div><p>So it says I have 8 processors on my current laptop, and I do. Check.</p>
<h2 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I need to spend more time here.</p>
]]></content>
		</item>
		
		<item>
			<title>Prometheus</title>
			<link>https://zwrob.com/en/posts/prometheus-agent/</link>
			<pubDate>Fri, 28 Jun 2019 11:03:04 -0700</pubDate><guid>https://zwrob.com/en/posts/prometheus-agent/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><a href="https://prometheus.io" target="_blank" >Prometheus</a> is a common monitoring system and is a good place to start looking into the details of monitoring because:</p>
<ul>
<li>Prometheus is implemented in Go, so the code is easy to follow</li>
<li>The source is commented, not well, but enough</li>
<li>Prometheus includes both a host agent and a collector/aggregator</li>
</ul>
<p>Let&rsquo;s take a look at the Prometheus agent.</p>
<h2 id="agent">Agent<a href="#agent" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Prometheus has a metrics collection agent, written in &lsquo;Go&rsquo;, called <a href="https://github.com/prometheus/node_exporter" target="_blank" >node_exporter</a>.</p>
<p>The code in node_exporter can be thought of as broken into 3 separate chunks: startup, metrics collection, and metrics serving.</p>
<p>(The code listings below have all but the nuts and bolts elided. Look at the original source via the provided links for full context.)</p>
<h3 id="startup">Startup<a href="#startup" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>We enter into all <code>Go</code> code via <code>main</code>:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L131-L131" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L131-L131</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#66d9ef">func</span> <span style="color:#a6e22e">main</span>() {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">Handle</span>(<span style="color:#f92672">*</span><span style="color:#a6e22e">metricsPath</span>, <span style="color:#a6e22e">newHandler</span>(!<span style="color:#f92672">*</span><span style="color:#a6e22e">disableExporterMetrics</span>, <span style="color:#f92672">*</span><span style="color:#a6e22e">maxRequests</span>))
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">err</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">ListenAndServe</span>(<span style="color:#f92672">*</span><span style="color:#a6e22e">listenAddress</span>, <span style="color:#66d9ef">nil</span>); <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> { <span style="color:#a6e22e">log</span>.<span style="color:#a6e22e">Fatal</span>(<span style="color:#a6e22e">err</span>) }
</span></span></code></pre></div><p>So <code>main</code> is constructing an httpHandler via newHandler and then handing that off to the http server. Does this mean that this collector
is only collecting metrics upon receiving a web request to serve up those metrics? Hmmmm&hellip;.</p>
<p><code>newHandler</code> is essentially creating an <code>innerHandler</code>. Let&rsquo;s ignore the code path where we pass in a custom set of collection filters
in the query string to the server and stick with the default behaviour. In this case, <code>newHandler</code> creates an <code>innerHandler</code> here:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L42" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L42</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#66d9ef">func</span> <span style="color:#a6e22e">newHandler</span>(<span style="color:#a6e22e">includeExporterMetrics</span> <span style="color:#66d9ef">bool</span>, <span style="color:#a6e22e">maxRequests</span> <span style="color:#66d9ef">int</span>) <span style="color:#f92672">*</span><span style="color:#a6e22e">handler</span> {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">h</span> <span style="color:#f92672">:=</span> <span style="color:#f92672">&amp;</span><span style="color:#a6e22e">handler</span>{<span style="color:#f92672">...</span> }
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">innerHandler</span>, <span style="color:#a6e22e">err</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">h</span>.<span style="color:#a6e22e">innerHandler</span>(); <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> {<span style="color:#f92672">...</span>}
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">h</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p><code>innerHandler</code> is where all the meat is. This is the function that actually set&rsquo;s up the metrics collectors:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L83-L83" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/node_exporter.go#L83-L83</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// innerHandler is used to create buth the one unfiltered http.Handler to be</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// wrapped by the outer handler and also the filtered handlers created on the</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// fly. The former is accomplished by calling innerHandler without any arguments</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// (in which case it will log all the collectors enabled via command-line</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// flags).</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">func</span> (<span style="color:#a6e22e">h</span> <span style="color:#f92672">*</span><span style="color:#a6e22e">handler</span>) <span style="color:#a6e22e">innerHandler</span>(<span style="color:#a6e22e">filters</span> <span style="color:#f92672">...</span><span style="color:#66d9ef">string</span>) (<span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">Handler</span>, <span style="color:#66d9ef">error</span>) {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">nc</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">collector</span>.<span style="color:#a6e22e">NewNodeCollector</span>(<span style="color:#a6e22e">filters</span><span style="color:#f92672">...</span>)
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">r</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">NewRegistry</span>()
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">MustRegister</span>(<span style="color:#a6e22e">version</span>.<span style="color:#a6e22e">NewCollector</span>(<span style="color:#e6db74">&#34;node_exporter&#34;</span>))
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">Register</span>(<span style="color:#a6e22e">nc</span>)
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">handler</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">promhttp</span>.<span style="color:#a6e22e">HandlerFor</span>(
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">Gatherers</span>{<span style="color:#a6e22e">h</span>.<span style="color:#a6e22e">exporterMetricsRegistry</span>, <span style="color:#a6e22e">r</span>},
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">promhttp</span>.<span style="color:#a6e22e">HandlerOpts</span>{
</span></span><span style="display:flex;"><span>			<span style="color:#a6e22e">ErrorLog</span>:            <span style="color:#a6e22e">log</span>.<span style="color:#a6e22e">NewErrorLogger</span>(),
</span></span><span style="display:flex;"><span>			<span style="color:#a6e22e">ErrorHandling</span>:       <span style="color:#a6e22e">promhttp</span>.<span style="color:#a6e22e">ContinueOnError</span>,
</span></span><span style="display:flex;"><span>			<span style="color:#a6e22e">MaxRequestsInFlight</span>: <span style="color:#a6e22e">h</span>.<span style="color:#a6e22e">maxRequests</span>,
</span></span><span style="display:flex;"><span>		},
</span></span><span style="display:flex;"><span>	)
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">handler</span>, <span style="color:#66d9ef">nil</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The key takeaway above is that the <code>innerHandler()</code> method is constructing a list of collectors, registering the collectors into a new registry, and then passing
the registry into a constructor for <code>prometheus.Gatherers</code>, and returning a handler that wraps all of this goodness. Now we know how the application is started and how
the handler is constructed. The next question is what happens when the handler is invoked? So on to the next section&hellip;</p>
<h3 id="collection">Collection<a href="#collection" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>What is the <code>prometheus.Gatherers</code> all about and what is inside the handler returned by <code>promhttp.HondlerFor()</code>?</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go#L80-L80" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go#L80-L80</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// HandlerFor returns an uninstrumented http.Handler for the provided Gatherer. </span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">func</span> <span style="color:#a6e22e">HandlerFor</span>(<span style="color:#a6e22e">reg</span> <span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">Gatherer</span>, <span style="color:#a6e22e">opts</span> <span style="color:#a6e22e">HandlerOpts</span>) <span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">Handler</span> {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">h</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">HandlerFunc</span>(<span style="color:#66d9ef">func</span>(<span style="color:#a6e22e">rsp</span> <span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">ResponseWriter</span>, <span style="color:#a6e22e">req</span> <span style="color:#f92672">*</span><span style="color:#a6e22e">http</span>.<span style="color:#a6e22e">Request</span>) {
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">mfs</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">reg</span>.<span style="color:#a6e22e">Gather</span>()
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">w</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">io</span>.<span style="color:#a6e22e">Writer</span>(<span style="color:#a6e22e">rsp</span>)
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">enc</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">expfmt</span>.<span style="color:#a6e22e">NewEncoder</span>(<span style="color:#a6e22e">w</span>, <span style="color:#a6e22e">contentType</span>)
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">for</span> <span style="color:#a6e22e">_</span>, <span style="color:#a6e22e">mf</span> <span style="color:#f92672">:=</span> <span style="color:#66d9ef">range</span> <span style="color:#a6e22e">mfs</span> {
</span></span><span style="display:flex;"><span>			<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">err</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">enc</span>.<span style="color:#a6e22e">Encode</span>(<span style="color:#a6e22e">mf</span>); <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> {
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>So <code>HandlerFor</code> returns a <code>handlerFunc</code> that invokes <code>Gather()</code> and then writes the encoded data onto the response. Pretty straight forward.</p>
<p>What does <code>Gather()</code> do? Well the <a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/registry.go#L135-L135" target="_blank" >Gatherer interface</a> implements the <a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/registry.go#L159" target="_blank" >Gather()</a> method. And this is ultimately the method that get&rsquo;s invoked by the registry here:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/registry.go#L405-L405" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/registry.go#L405-L405</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// Gather implements Gatherer.</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">func</span> (<span style="color:#a6e22e">r</span> <span style="color:#f92672">*</span><span style="color:#a6e22e">Registry</span>) <span style="color:#a6e22e">Gather</span>() ([]<span style="color:#f92672">*</span><span style="color:#a6e22e">dto</span>.<span style="color:#a6e22e">MetricFamily</span>, <span style="color:#66d9ef">error</span>) {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">mtx</span>.<span style="color:#a6e22e">RLock</span>()
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">checkedCollectors</span> <span style="color:#f92672">:=</span> make(<span style="color:#66d9ef">chan</span> <span style="color:#a6e22e">Collector</span>, len(<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">collectorsByID</span>))
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">for</span> <span style="color:#a6e22e">_</span>, <span style="color:#a6e22e">collector</span> <span style="color:#f92672">:=</span> <span style="color:#66d9ef">range</span> <span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">collectorsByID</span> {
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">checkedCollectors</span> <span style="color:#f92672">&lt;-</span> <span style="color:#a6e22e">collector</span>
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">mtx</span>.<span style="color:#a6e22e">RUnlock</span>()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">collectWorker</span> <span style="color:#f92672">:=</span> <span style="color:#66d9ef">func</span>() {
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">collector</span> <span style="color:#f92672">:=</span> <span style="color:#f92672">&lt;-</span><span style="color:#a6e22e">checkedCollectors</span>:
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">collector</span>.<span style="color:#a6e22e">Collect</span>(<span style="color:#a6e22e">checkedMetricChan</span>)
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	<span style="color:#75715e">// Start the first worker now to make sure at least one is running.</span>
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">go</span> <span style="color:#a6e22e">collectWorker</span>()
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">internal</span>.<span style="color:#a6e22e">NormalizeMetricFamilies</span>(<span style="color:#a6e22e">metricFamiliesByName</span>), <span style="color:#a6e22e">errs</span>.<span style="color:#a6e22e">MaybeUnwrap</span>()
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The <code>Gatherer.Gather()</code> function iterates over all the available collectors and pushes them onto a channel. Then it fires up go routine(s) to invoke the <code>Collector.Collect()</code> method on these collectors. When complete, the function returns a bunch of metrics data.</p>
<p>What is the <code>Collector</code> interface all about you ask? Here it is:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/collector.go#L16-L16" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/collector.go#L16-L16</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// Collector is the interface implemented by anything that can be used by</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Prometheus to collect metrics. </span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">type</span> <span style="color:#a6e22e">Collector</span> <span style="color:#66d9ef">interface</span> {
</span></span><span style="display:flex;"><span>	<span style="color:#75715e">// Collect is called by the Prometheus registry when collecting</span>
</span></span><span style="display:flex;"><span>	<span style="color:#75715e">// metrics. The implementation sends each collected metric via the</span>
</span></span><span style="display:flex;"><span>	<span style="color:#75715e">// provided channel and returns once the last metric has been sent. </span>
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">Collect</span>(<span style="color:#66d9ef">chan</span><span style="color:#f92672">&lt;-</span> <span style="color:#a6e22e">Metric</span>)
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>So that&rsquo;s the code at a high level. Now let&rsquo;s deep dive into one particular collector, the CPU collector, to see how these metrics are being pulled
from the operating system.</p>
<h3 id="cpu-metrics">CPU Metrics<a href="#cpu-metrics" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>The source code related to CPU metrics is organized under the <code>collector</code> directory, with files named as <code>{METRIC_NAME}_{OPERATING_SYSTEM}.go</code>.</p>
<p>Here&rsquo;s a listing of the cpu metrics collector go source files:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>~/repos/external/prom $ tree node_exporter/collector/ -L <span style="color:#ae81ff">1</span> | grep cpu_
</span></span><span style="display:flex;"><span>├── cpu_common.go
</span></span><span style="display:flex;"><span>├── cpu_darwin.go
</span></span><span style="display:flex;"><span>├── cpu_dragonfly.go
</span></span><span style="display:flex;"><span>├── cpu_dragonfly_test.go
</span></span><span style="display:flex;"><span>├── cpu_freebsd.go
</span></span><span style="display:flex;"><span>├── cpu_linux.go
</span></span><span style="display:flex;"><span>├── cpu_openbsd.go
</span></span><span style="display:flex;"><span>├── cpu_solaris.go
</span></span></code></pre></div><p>As you can see, there is a different source code file for each OS. Since I&rsquo;m testing on Linux platforms, let&rsquo;s look at <code>cpu_linux.go</code>.</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/7e684f16aecf8121e41b39fa45a3ab969e9b1cd1/collector/cpu_linux.go#L156" target="_blank" >https://github.com/prometheus/node_exporter/blob/7e684f16aecf8121e41b39fa45a3ab969e9b1cd1/collector/cpu_linux.go#L156</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// updateStat reads /proc/stat through procfs and exports cpu related metrics.</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">func</span> (<span style="color:#a6e22e">c</span> <span style="color:#f92672">*</span><span style="color:#a6e22e">cpuCollector</span>) <span style="color:#a6e22e">updateStat</span>(<span style="color:#a6e22e">ch</span> <span style="color:#66d9ef">chan</span><span style="color:#f92672">&lt;-</span> <span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">Metric</span>) <span style="color:#66d9ef">error</span> {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">stats</span>, <span style="color:#a6e22e">err</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">Stat</span>()
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> {
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">err</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><ul>
<li><strong>Q: What&rsquo;s this <code>c.fs</code> object?</strong></li>
</ul>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/procfs/fs.go#L20" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/procfs/fs.go#L20</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// FS represents the pseudo-filesystem sys, which provides an interface to</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// kernel data structures.</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">type</span> <span style="color:#a6e22e">FS</span> <span style="color:#66d9ef">struct</span> {
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">proc</span> <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">FS</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><ul>
<li><strong>Q: I&rsquo;ve heard of sys and procfs&hellip; what are these again?</strong></li>
</ul>
<p>I have a whole writeup on <a href="../linux-procfs/" >Linux&rsquo;s Procfs</a>.</p>
<h5 id="prometheus-procfs-library">Prometheus&rsquo; Procfs Library<a href="#prometheus-procfs-library" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<ul>
<li><strong>Q: So what&rsquo;s <code>c.fs.Stat()</code> doing?</strong></li>
<li>A: It&rsquo;s calling into a separate <a href="https://github.com/prometheus/procfs" target="_blank" >prometheus library called procfs</a>.</li>
</ul>
<p>Here&rsquo;s what the prometheus procfs library is all about:</p>
<p><a href="https://github.com/prometheus/procfs#usage" target="_blank" >https://github.com/prometheus/procfs#usage</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>The procfs library is organized by packages based on whether the gathered data
</span></span><span style="display:flex;"><span>is coming from /proc, /sys, or both. Each package contains an FS type which
</span></span><span style="display:flex;"><span>represents the path to either /proc, /sys, or both. For example, current cpu
</span></span><span style="display:flex;"><span>statistics are gathered from /proc/stat and are available via the root procfs
</span></span><span style="display:flex;"><span>package.
</span></span></code></pre></div><p>Back to the call to <code>stats, err := c.fs.Stat()</code>:</p>
<p><a href="https://github.com/prometheus/procfs/blob/master/stat.go#L164" target="_blank" >https://github.com/prometheus/procfs/blob/master/stat.go#L164</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span><span style="color:#75715e">// Stat returns information about current cpu/process statistics.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">func</span> (<span style="color:#a6e22e">fs</span> <span style="color:#a6e22e">FS</span>) <span style="color:#a6e22e">Stat</span>() (<span style="color:#a6e22e">Stat</span>, <span style="color:#66d9ef">error</span>) {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">f</span>, <span style="color:#a6e22e">err</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">os</span>.<span style="color:#a6e22e">Open</span>(<span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">proc</span>.<span style="color:#a6e22e">Path</span>(<span style="color:#e6db74">&#34;stat&#34;</span>))
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> {
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">Stat</span>{}, <span style="color:#a6e22e">err</span>
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">defer</span> <span style="color:#a6e22e">f</span>.<span style="color:#a6e22e">Close</span>()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">stat</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">Stat</span>{}
</span></span></code></pre></div><p>Cool! Not only can we see that it&rsquo;s opening a standard file to read from, it&rsquo;s also well documented code! Let&rsquo;s take a look at the referenced docs at kernel.org.</p>
<h5 id="procfs-library-usage">Procfs Library Usage<a href="#procfs-library-usage" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h5>
<p>The rest of the code at <a href="https://github.com/prometheus/procfs/blob/39e1aff1547e9a628f5714cc5f73d058ba44258e/stat.go#L176" target="_blank" >procfs/stat.go</a> is basically reading the from the file, parsing the data into lines, then splitting the lines by whitespace, and returning a struct with UINTs parsed from the strings. It&rsquo;s not that interesting&hellip; frankly the
only thing that is interesting about it is how straight forward it is:</p>
<p><a href="https://github.com/prometheus/procfs/blob/39e1aff1547e9a628f5714cc5f73d058ba44258e/stat.go#L176" target="_blank" >https://github.com/prometheus/procfs/blob/39e1aff1547e9a628f5714cc5f73d058ba44258e/stat.go#L176</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span>        <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// [ME] read from file</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>	<span style="color:#a6e22e">scanner</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">bufio</span>.<span style="color:#a6e22e">NewScanner</span>(<span style="color:#a6e22e">f</span>)
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">for</span> <span style="color:#a6e22e">scanner</span>.<span style="color:#a6e22e">Scan</span>() {
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// [ME] break file into lines</span>
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">line</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">scanner</span>.<span style="color:#a6e22e">Text</span>()
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// [ME] break lines into parts based on white space separation</span>
</span></span><span style="display:flex;"><span>                <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">parts</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">strings</span>.<span style="color:#a6e22e">Fields</span>(<span style="color:#a6e22e">scanner</span>.<span style="color:#a6e22e">Text</span>())
</span></span><span style="display:flex;"><span>		<span style="color:#75715e">// require at least &lt;key&gt; &lt;value&gt;</span>
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">if</span> len(<span style="color:#a6e22e">parts</span>) &lt; <span style="color:#ae81ff">2</span> {
</span></span><span style="display:flex;"><span>			<span style="color:#66d9ef">continue</span>
</span></span><span style="display:flex;"><span>		}
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">switch</span> {
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">case</span> <span style="color:#a6e22e">parts</span>[<span style="color:#ae81ff">0</span>] <span style="color:#f92672">==</span> <span style="color:#e6db74">&#34;btime&#34;</span>:
</span></span><span style="display:flex;"><span>                        <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>                        <span style="color:#75715e">// [ME] parse string into UINT</span>
</span></span><span style="display:flex;"><span>                        <span style="color:#75715e">// ----------------------------------------------</span>
</span></span><span style="display:flex;"><span>			<span style="color:#66d9ef">if</span> <span style="color:#a6e22e">stat</span>.<span style="color:#a6e22e">BootTime</span>, <span style="color:#a6e22e">err</span> = <span style="color:#a6e22e">strconv</span>.<span style="color:#a6e22e">ParseUint</span>(<span style="color:#a6e22e">parts</span>[<span style="color:#ae81ff">1</span>], <span style="color:#ae81ff">10</span>, <span style="color:#ae81ff">64</span>); <span style="color:#a6e22e">err</span> <span style="color:#f92672">!=</span> <span style="color:#66d9ef">nil</span> {
</span></span><span style="display:flex;"><span>				<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">Stat</span>{}, <span style="color:#a6e22e">fmt</span>.<span style="color:#a6e22e">Errorf</span>(<span style="color:#e6db74">&#34;couldn&#39;t parse %s (btime): %s&#34;</span>, <span style="color:#a6e22e">parts</span>[<span style="color:#ae81ff">1</span>], <span style="color:#a6e22e">err</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">...</span>
</span></span></code></pre></div><p>This <code>stat</code> object is then returned to the caller and the results written to a go <code>channel</code> here:</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/7e684f16aecf8121e41b39fa45a3ab969e9b1cd1/collector/cpu_linux.go#L163" target="_blank" >https://github.com/prometheus/node_exporter/blob/7e684f16aecf8121e41b39fa45a3ab969e9b1cd1/collector/cpu_linux.go#L163</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-golang" data-lang="golang"><span style="display:flex;"><span>	<span style="color:#66d9ef">for</span> <span style="color:#a6e22e">cpuID</span>, <span style="color:#a6e22e">cpuStat</span> <span style="color:#f92672">:=</span> <span style="color:#66d9ef">range</span> <span style="color:#a6e22e">stats</span>.<span style="color:#a6e22e">CPU</span> {
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">cpuNum</span> <span style="color:#f92672">:=</span> <span style="color:#a6e22e">fmt</span>.<span style="color:#a6e22e">Sprintf</span>(<span style="color:#e6db74">&#34;%d&#34;</span>, <span style="color:#a6e22e">cpuID</span>)
</span></span><span style="display:flex;"><span>                <span style="color:#a6e22e">ch</span> <span style="color:#f92672">&lt;-</span> <span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">MustNewConstMetric</span>(<span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">cpu</span>, <span style="color:#a6e22e">prometheus</span>.<span style="color:#a6e22e">CounterValue</span>, <span style="color:#a6e22e">cpuStat</span>.<span style="color:#a6e22e">User</span>, <span style="color:#a6e22e">cpuNum</span>, <span style="color:#e6db74">&#34;user&#34;</span>)
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">...</span>
</span></span></code></pre></div><p>This bit is a little confusing. Why is this code calling <code>prometheus.MustNewConstMetric()</code> and not one of the standard
emitters such as a <code>Counter</code> or <code>Guage</code>? We know from the kernel.org docs that the CPU values are cumulative totals since
the machine was last booted. We also know that the values never decrease. Perhaps it&rsquo;s because these values are
pass-through and don&rsquo;t quite follow the semantics of a Counter or Guage? Frankly, I&rsquo;m not sure why these are defined as
<code>MustNewConstMetric()</code> and not <code>NewConstMetric()</code> or <code>NewGauge</code>&hellip;</p>
<p>Perhaps the documentation can help:</p>
<p><a href="https://godoc.org/github.com/prometheus/client_golang/prometheus#hdr-Custom_Collectors_and_constant_Metrics" target="_blank" >https://godoc.org/github.com/prometheus/client_golang/prometheus#hdr-Custom_Collectors_and_constant_Metrics</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>If you already have metrics available, created outside of the Prometheus
</span></span><span style="display:flex;"><span>context, you don&#39;t need the interface of the various Metric types. You
</span></span><span style="display:flex;"><span>essentially want to mirror the existing numbers into Prometheus Metrics during
</span></span><span style="display:flex;"><span>collection. An own implementation of the Collector interface is perfect for
</span></span><span style="display:flex;"><span>that.
</span></span></code></pre></div><p>Since cpu_linux is simply mirroring (pass-through, whatever) the metrics that the OS has already collected, then
we can use these purpose-built metrics for them. Perhaps they are faster or more memory efficient?</p>
<p><a href="https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/value.go#L79-L79" target="_blank" >https://github.com/prometheus/node_exporter/blob/e972e38b423632a4f45326bd33eb127a4935f1f6/vendor/github.com/prometheus/client_golang/prometheus/value.go#L79-L79</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>// NewConstMetric returns an error if the length of
</span></span><span style="display:flex;"><span>// labelValues is not consistent with the variable labels in Desc or if Desc is
</span></span><span style="display:flex;"><span>// invalid.
</span></span></code></pre></div><p>I suspect the reason to use MustNewConstMetric is a simpler code path while still checking for naming consistency of the emitted metrics.</p>
<h2 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Prometheus agent reading CPU stats, on Linux, via Procfs. The call chain goes something like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>node_exporter 
</span></span><span style="display:flex;"><span>    -&gt; http.Handler 
</span></span><span style="display:flex;"><span>        -&gt; onRequest 
</span></span><span style="display:flex;"><span>            -&gt; Gather 
</span></span><span style="display:flex;"><span>                -&gt; Collect 
</span></span><span style="display:flex;"><span>                    -&gt; CPU_Collector 
</span></span><span style="display:flex;"><span>                        -&gt; Procfs 
</span></span><span style="display:flex;"><span>                            -&gt; read from the linux procfs pseudo file system
</span></span><span style="display:flex;"><span>                                -&gt; prometheus.MustNewConstMetric<span style="color:#f92672">(</span>...<span style="color:#f92672">)</span>
</span></span></code></pre></div><p>Now that we know the pattern, it&rsquo;s fairly easy to deconstruct the rest of the collectors, as needed.</p>
]]></content>
		</item>
		
		<item>
			<title>Monitoring : Part 2</title>
			<link>https://zwrob.com/en/posts/monitoring-02/</link>
			<pubDate>Thu, 27 Jun 2019 10:52:05 -0700</pubDate><guid>https://zwrob.com/en/posts/monitoring-02/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>In the previous post, <a href="../monitoring-01/" >Monitoring : Part 1</a> I showed off a monitoring solution that I created in order to examine the performance of various algorithms during test runs. However, I quickly noticed that the results of two different collectors, <code>collectd</code> and <code>prometheus' node-exporter</code> were inconsistent. From this I realized that I really needed to dive into the details of instrumentation, collection, aggregation and display. In this post, I&rsquo;ll take a look at how Linux exposes host metrics and in particular how the Prometheus agent, called <code>node_exporter</code>, reads the Linux host metrics.</p>
<h2 id="overview">Overview<a href="#overview" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>I&rsquo;ve broken this post out into subsections to make this more digestable:</p>
<ul>
<li><a href="../monitoring-01/" >Monitoring : Part 1</a></li>
<li><a href="../linux-procfs/" >Linux Metrics : procfs</a></li>
<li><a href="https://godoc.org/github.com/prometheus/client_golang/prometheus" target="_blank" >Prometheus Client : golang</a></li>
<li><a href="../prometheus-agent/" >Prometheus Agent : node_exporter</a></li>
</ul>
<p>Once you have digested the contents of those two posts, the rest of this will be pretty straight forward.</p>
<ol>
<li>Linux servers up kernel level information such as host stats via <a href="../linux-procfs/" >sys and procfs</a></li>
<li>The Prometheus agent slurps up those metrics and parses them by parsing the text in the pseudo file <code>/proc/stats</code></li>
<li>The Prometheus agent then serves those metrics via a url as : <code>http://localhost:[PORT]/metrics</code></li>
<li>The Prometheus collector/aggregator makes an http GET request to that url to retrieve the metrics</li>
</ol>
<h3 id="example">Example<a href="#example" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>The serving part was essentially covered in 1 and 2 where we showed the metrics getting written to the response. In order to see this in action, fire up the node_exporter and curl the listed url to get a metrics report.</p>
<p>First, build the node_exporter&hellip;</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ cd node_exporter
</span></span><span style="display:flex;"><span>$ make
</span></span><span style="display:flex;"><span>...
</span></span></code></pre></div><p>Now, start the node_exporter&hellip;</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span> $ ./node_exporter
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span> Starting node_exporter <span style="color:#f92672">(</span>version<span style="color:#f92672">=</span>0.18.1, branch<span style="color:#f92672">=</span>master, revision<span style="color:#f92672">=</span>e972e38b423632a4f45326bd33eb127a4935f1f6<span style="color:#f92672">)</span>  source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:156&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span> Build context <span style="color:#f92672">(</span>go<span style="color:#f92672">=</span>go1.12.6, user<span style="color:#f92672">=</span>toddg@dino, date<span style="color:#f92672">=</span>20190628-15:55:33<span style="color:#f92672">)</span>  source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:157&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span> Enabled collectors:                           source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:97&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - arp                                        source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - bcache                                     source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - bonding                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - conntrack                                  source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - cpu                                        source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - cpufreq                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - diskstats                                  source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - edac                                       source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - entropy                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - filefd                                     source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - filesystem                                 source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - hwmon                                      source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - infiniband                                 source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - ipvs                                       source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - loadavg                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - mdadm                                      source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - meminfo                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - netclass                                   source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - netdev                                     source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - netstat                                    source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - nfs                                        source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - nfsd                                       source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - pressure                                   source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - sockstat                                   source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - stat                                       source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - textfile                                   source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - time                                       source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - timex                                      source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - uname                                      source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - vmstat                                     source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - xfs                                        source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span>  - zfs                                        source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:104&#34;</span>
</span></span><span style="display:flex;"><span>INFO<span style="color:#f92672">[</span>0000<span style="color:#f92672">]</span> Listening on :9100                            source<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;node_exporter.go:170&#34;</span>
</span></span></code></pre></div><p>Try curling localhost:9100&hellip;</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ curl localhost:9100
</span></span><span style="display:flex;"><span>&lt;html&gt;
</span></span><span style="display:flex;"><span>			&lt;head&gt;&lt;title&gt;Node Exporter&lt;/title&gt;&lt;/head&gt;
</span></span><span style="display:flex;"><span>			&lt;body&gt;
</span></span><span style="display:flex;"><span>			&lt;h1&gt;Node Exporter&lt;/h1&gt;
</span></span><span style="display:flex;"><span>			&lt;p&gt;&lt;a href<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;/metrics&#34;</span>&gt;Metrics&lt;/a&gt;&lt;/p&gt;
</span></span><span style="display:flex;"><span>			&lt;/body&gt;
</span></span><span style="display:flex;"><span>			&lt;/html&gt;~/repos/external/prom/node_exporter
</span></span></code></pre></div><p>That&rsquo;s exactly what we saw in the code. Perfect. Append <code>metrics</code> to the url and curl again&hellip;</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ curl localhost:9100/metrics
</span></span><span style="display:flex;"><span><span style="color:#75715e"># HELP go_gc_duration_seconds A summary of the GC invocation durations.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># TYPE go_gc_duration_seconds summary</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds<span style="color:#f92672">{</span>quantile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds<span style="color:#f92672">{</span>quantile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0.25&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds<span style="color:#f92672">{</span>quantile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0.5&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds<span style="color:#f92672">{</span>quantile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0.75&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds<span style="color:#f92672">{</span>quantile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;1&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds_sum <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>go_gc_duration_seconds_count <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># HELP go_goroutines Number of goroutines that currently exist.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># TYPE go_goroutines gauge</span>
</span></span><span style="display:flex;"><span>go_goroutines <span style="color:#ae81ff">8</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># HELP go_info Information about the Go environment.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># TYPE go_info gauge</span>
</span></span><span style="display:flex;"><span>go_info<span style="color:#f92672">{</span>version<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;go1.12.6&#34;</span><span style="color:#f92672">}</span> <span style="color:#ae81ff">1</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># TYPE go_memstats_alloc_bytes gauge</span>
</span></span><span style="display:flex;"><span>go_memstats_alloc_bytes <span style="color:#ae81ff">906112</span>
</span></span><span style="display:flex;"><span>...
</span></span></code></pre></div><p>There&rsquo;s a lot of output generated here, so see this <a href="https://gist.github.com/ToddG/7e5016b51bb8fe6f05ef358bde6c00d0" target="_blank" >gist</a> for a full sample output.</p>
<h3 id="verification">Verification<a href="#verification" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Does all this work as expected? Let&rsquo;s take a top level view, knowing what we know now:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ curl localhost:9100/metrics | grep cpu | grep idle; cat /proc/stat
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;0&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 173053.7
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;1&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60628.78
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;2&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60319.59
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;3&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60668.45
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;4&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60367.33
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;5&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60750.17
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;6&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60363.55
</span></span><span style="display:flex;"><span>node_cpu_seconds_total<span style="color:#f92672">{</span>cpu<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;7&#34;</span>,mode<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idle&#34;</span><span style="color:#f92672">}</span> 60724.35
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>// from the docs, <span style="color:#e6db74">&#39;idle&#39;</span> is the 4th column reported by /proc/stat
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>cpu  <span style="color:#ae81ff">1769022</span> <span style="color:#ae81ff">21772</span> <span style="color:#ae81ff">573346</span> <span style="color:#ae81ff">59687683</span> <span style="color:#ae81ff">52777</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">16659</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu0 <span style="color:#ae81ff">261911</span> <span style="color:#ae81ff">2143</span> <span style="color:#ae81ff">80436</span> <span style="color:#ae81ff">17305381</span> <span style="color:#ae81ff">16340</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">9367</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu1 <span style="color:#ae81ff">175662</span> <span style="color:#ae81ff">1669</span> <span style="color:#ae81ff">54010</span> <span style="color:#ae81ff">6062890</span> <span style="color:#ae81ff">9968</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1779</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu2 <span style="color:#ae81ff">269207</span> <span style="color:#ae81ff">3138</span> <span style="color:#ae81ff">82611</span> <span style="color:#ae81ff">6031970</span> <span style="color:#ae81ff">7467</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">778</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu3 <span style="color:#ae81ff">172678</span> <span style="color:#ae81ff">2143</span> <span style="color:#ae81ff">60796</span> <span style="color:#ae81ff">6066852</span> <span style="color:#ae81ff">4373</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">208</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu4 <span style="color:#ae81ff">269848</span> <span style="color:#ae81ff">2975</span> <span style="color:#ae81ff">82810</span> <span style="color:#ae81ff">6036745</span> <span style="color:#ae81ff">3139</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">181</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu5 <span style="color:#ae81ff">175312</span> <span style="color:#ae81ff">2104</span> <span style="color:#ae81ff">60435</span> <span style="color:#ae81ff">6075029</span> <span style="color:#ae81ff">2152</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">386</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu6 <span style="color:#ae81ff">270884</span> <span style="color:#ae81ff">4214</span> <span style="color:#ae81ff">96732</span> <span style="color:#ae81ff">6036367</span> <span style="color:#ae81ff">5641</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">672</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>cpu7 <span style="color:#ae81ff">173518</span> <span style="color:#ae81ff">3383</span> <span style="color:#ae81ff">55513</span> <span style="color:#ae81ff">6072446</span> <span style="color:#ae81ff">3693</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">3286</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">0</span>
</span></span></code></pre></div><p>Let&rsquo;s compare the results&hellip; The docs also say that &ldquo;&ldquo;&ldquo;Time units are in USER_HZ (typically hundredths of a
second)&rdquo;&rdquo;&rdquo; so normalizing by X/100 gives us:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>idle            idle          idle 
</span></span><span style="display:flex;"><span>localhost:      cat           cat
</span></span><span style="display:flex;"><span>/metrics        /proc/stat    /proc/stat
</span></span><span style="display:flex;"><span><span style="color:#f92672">(</span>seconds<span style="color:#f92672">)</span>       <span style="color:#f92672">(</span>USER_HZ<span style="color:#f92672">)</span>     <span style="color:#f92672">(</span>normalized to seconds<span style="color:#f92672">)</span> X/100
</span></span><span style="display:flex;"><span>-----------------------------------------------
</span></span><span style="display:flex;"><span>173053.7      <span style="color:#ae81ff">17305381</span>        173053.8
</span></span><span style="display:flex;"><span> 60628.78      <span style="color:#ae81ff">6062890</span>         60628.90
</span></span><span style="display:flex;"><span> 60319.59      <span style="color:#ae81ff">6031970</span>         60319.70
</span></span><span style="display:flex;"><span> 60668.45      <span style="color:#ae81ff">6066852</span>         60668.52
</span></span><span style="display:flex;"><span> 60367.33      <span style="color:#ae81ff">6036745</span>         60367.45
</span></span><span style="display:flex;"><span> 60750.17      <span style="color:#ae81ff">6075029</span>         60750.29
</span></span><span style="display:flex;"><span> 60363.55      <span style="color:#ae81ff">6036367</span>         60363.67
</span></span><span style="display:flex;"><span> 60724.35      <span style="color:#ae81ff">6072446</span>         60724.46
</span></span></code></pre></div><p>So things look good down to the second. There seems to be a difference in rounding at the subsecond level.</p>
<h2 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>The Prometheus node_exporter is doing the exact same thing I was doing by hand&hellip; cat&rsquo;ing out a pseduo file and scraping the results. Only node_exporter also exposes the metrics via a URL.</p>
]]></content>
		</item>
		
		<item>
			<title>Monitoring : Part 1</title>
			<link>https://zwrob.com/en/posts/monitoring-01/</link>
			<pubDate>Tue, 25 Jun 2019 10:52:05 -0700</pubDate><guid>https://zwrob.com/en/posts/monitoring-01/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>While characterizing the performance of Erlang with a distributed problem (see <a href="../parallelization/" >Parallelization</a>), it became obvious that I also needed to better understand how to monitor applications in my own environment. I&rsquo;m typically developing in a corporate environment that already has monitoring and graphing solutions set up&hellip;so this is usually just a task of defining application specific metrics and then instrumenting the application(s) under development. However, right now I am developing applications without that infrastructure in place, and it turns out to be really interesting setting all of this up.</p>
<h2 id="background">Background<a href="#background" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<ul>
<li><a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-metrics-monitoring-and-alerting" target="_blank" >Intro to monitoring</a></li>
<li><a href="https://www.loomsystems.com/blog/single-post/2017/06/07/prometheus-vs-grafana-vs-graphite-a-feature-comparison" target="_blank" >System Comparison</a></li>
</ul>
<h2 id="monitor">Monitor<a href="#monitor" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>So, the first thing I tackled is creating a <code>docker-compose</code> based monitoring and reporting stack:</p>
<p><a href="https://github.com/toddg/monitor" target="_blank" >monitor</a></p>
<p>&lsquo;Monitor&rsquo; can be plugged into any build system (Makefile, etc.) and turns on monitoring on my dev box as part of a test run. It collects metrics from both collectd and from prometheus&rsquo; node-exporter. &lsquo;Monitor&rsquo; includes some basic grafana dashboards so that all you have to do is fire up a browser and start looking at the collected metrics in a standard and repeatable way. However, here be (tiny) dragons.</p>
<h3 id="questions">Questions<a href="#questions" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Plugging in a monitoring stack immediately raised a bunch of questions:</p>
<ul>
<li>Why are there so many different collectors and stores out there? How are they different?</li>
<li>What are some basic dashboards that would be useful to analyze applications written in Java, Python, Go, and Erlang?</li>
<li>How can I make application monitoring just a standard part of my workflow, with a low friction much like running unit tests?</li>
</ul>
<p>As I started using grafana and looking at the metrics being surfaced via collectd and prometheus collectors, I couldn&rsquo;t help but notice that the cpu and memory graphs looked different, and the units didn&rsquo;t make sense, either. Basically, what I was running into was my full lack of understanding of how metrics were being collected, what they mean, and how to surface them in a meaningful way.</p>
<p>It&rsquo;s time to deep dive into some code and docs and try to sort this out.</p>
<p>All that and more coming up next in <a href="../monitoring-02/" >Monitoring : Part 2</a>.</p>
]]></content>
		</item>
		
		<item>
			<title>Parallel Algorithms</title>
			<link>https://zwrob.com/en/posts/parallelization/</link>
			<pubDate>Sat, 22 Jun 2019 18:53:08 -0700</pubDate><guid>https://zwrob.com/en/posts/parallelization/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p>After characterizing various sorting algorithms (see <a href="../sorting" >Sorting</a>) I decided to pick an algorithm and use it to characterize how well Erlang performs distributed programming. Erlang provides a way to essentially fork and join a workload via <a href="http://erlang.org/doc/man/rpc.html#pmap-3" target="_blank" >rpc:pmap</a>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-erlang" data-lang="erlang"><span style="display:flex;"><span>rpc:<span style="color:#a6e22e">pmap</span>()
</span></span></code></pre></div><h3 id="questions">Questions<a href="#questions" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>Does Erlang follow Amdahl&rsquo;s Law?</li>
<li>What are the constant time factors for Erlang?</li>
<li>How easy is it to use?</li>
</ul>
<h3 id="analysis">Analysis<a href="#analysis" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p><a href="https://github.com/ToddG/experimental/blob/master/interview-questions/glassdoor/sorting/erlang/psortz/docs/parallel_sorting_analysis.ipynb" target="_blank" >Jupyter Notebook</a></p>
<h3 id="summary">Summary<a href="#summary" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>Parallelization of an embarrassingly parallel problem is certainly easy to do in Erlang, though the benefits of spreading a calculation across processors diminishes after the 2nd or 3rd processor.</p>
<ul>
<li>Does Erlang follow Amdahl&rsquo;s Law? (Yes)</li>
<li>What are the constant time factors for Erlang? (I didn&rsquo;t measure them but they are high)</li>
<li>How easy is it to use? (Yes, very easy to use)</li>
</ul>
<h3 id="links">Links<a href="#links" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li><a href="https://groups.google.com/forum/#!topic/erlang-programming/_smlcd6S9v0" target="_blank" >mailing list : skel</a></li>
<li><a href="https://skel.weebly.com/about-skel.html" target="_blank" >skel</a></li>
<li><a href="http://erlang.org/doc/man/rpc.html" target="_blank" >rpc docs</a></li>
<li><a href="https://en.wikipedia.org/wiki/Amdahl%27s_law" target="_blank" >Amdahl&rsquo;s Law</a></li>
</ul>
]]></content>
		</item>
		
		<item>
			<title>Sorting : Algorithm Performance</title>
			<link>https://zwrob.com/en/posts/sorting/</link>
			<pubDate>Sat, 22 Jun 2019 18:27:29 -0700</pubDate><guid>https://zwrob.com/en/posts/sorting/</guid>
			<description><![CDATA[&lt;no value&gt;]]></description><content type="text/html" mode="escaped"><![CDATA[<p><a href="https://www.glassdoor.com/Interview/software-engineer-interview-questions-SRCH_KO0,17.htm" target="_blank" >Recently I was puzzling the following question:</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>What sort would you use if you required tight 
</span></span><span style="display:flex;"><span>max time bounds and wanted highly regular 
</span></span><span style="display:flex;"><span>performance?
</span></span></code></pre></div><h3 id="discussion">Discussion<a href="#discussion" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>There were some answers but nothing beats implementing and measuring for yourself.</p>
<h4 id="inputs">Inputs<a href="#inputs" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>Constant value :      [1,1,1,&hellip;]</li>
<li>Sorted :              [1,2,3,&hellip;]</li>
<li>Reverse sorted:       [N, N-1, N-2, &hellip;]</li>
<li>Random:               [&hellip;]</li>
<li>Interleaved :         [Constant, Sorted, Reverse-sorted, Random, &hellip;]</li>
</ul>
<h4 id="algorithms">Algorithms<a href="#algorithms" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<ul>
<li>Insertion Sort</li>
<li>Quicksort</li>
<li>Heap Sort</li>
<li>Bucket Sort</li>
</ul>
<h4 id="input-data">Input Data<a href="#input-data" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h4>
<p><a href="https://github.com/ToddG/experimental/blob/master/interview-questions/glassdoor/sorting/erlang/sortz/docs/perf/perf_run.csv" target="_blank" >Data</a></p>
<h3 id="results">Results<a href="#results" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<ul>
<li>&lsquo;heapsort&rsquo; had the most consistent performance</li>
<li>&lsquo;quicksort&rsquo; had the fastest performance</li>
<li>&lsquo;quicksort&rsquo; had the worst performance</li>
</ul>
<p>Determining which sorting algorithm is &lsquo;best&rsquo; for a given use case actually depends on your requirements. If you need the fastest sorter possible, then that&rsquo;s probably quicksort. But if you need good overall performance for a wide variety of input types, you&rsquo;re probably going to want heapsort. The full analysis is captured here as a Jupyter Notebook (with lots of pretty graphs):</p>
<p><a href="https://github.com/ToddG/experimental/blob/master/interview-questions/glassdoor/sorting/erlang/sortz/docs/sorting_algorithms_analysis.ipynb" target="_blank" >Notebook</a></p>
]]></content>
		</item>
		
	</channel>
</rss>
