Skip to content

Instantly share code, notes, and snippets.

@tjhop
Created July 19, 2021 13:34
Show Gist options
  • Save tjhop/92c09dec47dfffb92eba6fe72b066df4 to your computer and use it in GitHub Desktop.
Save tjhop/92c09dec47dfffb92eba6fe72b066df4 to your computer and use it in GitHub Desktop.
go-discover optimize linode IP retreival
~/go/src/github.com/hashicorp/go-discover (master [ U ]) -> linode-cli linodes list --tags go-discover --text --no-headers | wc -l
50
~/go/src/github.com/hashicorp/go-discover (feat/optimize-linode-discovery [ U ]) -> time LINODE_TOKEN="${LINODE_API_TOKEN}" $HOME/go/bin/discover addrs provider=linode tag_name=go-discover
Registered providers: [aliyun aws azure digitalocean gce linode mdns os packet scaleway softlayer tencentcloud triton vsphere]
[DEBUG] discover: Using provider "linode"
[DEBUG] discover-linode: Using address_type= region= tag_name=go-discover
192.168.142.210 192.168.142.235 192.168.142.93 192.168.142.111 192.168.142.182 192.168.142.187 192.168.226.10 192.168.226.35 192.168.226.56 192.168.226.59 192.168.226.108 192.168.226.124 192.168.226.169 192.168.226.248 192.168.226.54 192.168.226.206 192.168.226.147 192.168.226.153 192.168.226.70 192.168.226.208 192.168.226.245 192.168.226.81 192.168.226.189 192.168.226.191 192.168.226.197 192.168.226.215 192.168.226.246 192.168.226.15 192.168.226.20 192.168.226.22 192.168.226.62 192.168.226.69 192.168.226.77 192.168.226.85 192.168.226.128 192.168.226.184 192.168.226.203 192.168.226.232 192.168.226.241 192.168.226.109 192.168.226.139 192.168.226.181 192.168.226.235 192.168.226.182 192.168.226.121 192.168.226.193 192.168.226.38 192.168.226.148 192.168.226.154 192.168.226.239
LINODE_TOKEN="${LINODE_API_TOKEN}" $HOME/go/bin/discover addrs provider=linode 0.11s user 0.05s system 0% cpu 26.814 total
~/go/src/github.com/hashicorp/go-discover (feat/optimize-linode-discovery [ U ]) -> time LINODE_TOKEN="${LINODE_API_TOKEN}" ./bin/discover addrs provider=linode tag_name=go-discover
Registered providers: [aliyun aws azure digitalocean gce linode mdns os packet scaleway softlayer tencentcloud triton vsphere]
[DEBUG] discover: Using provider "linode"
[DEBUG] discover-linode: Using address_type= region= tag_name=go-discover
192.168.142.210 192.168.142.235 192.168.142.93 192.168.142.111 192.168.142.182 192.168.142.187 192.168.226.10 192.168.226.35 192.168.226.56 192.168.226.59 192.168.226.108 192.168.226.124 192.168.226.169 192.168.226.248 192.168.226.54 192.168.226.206 192.168.226.147 192.168.226.153 192.168.226.70 192.168.226.208 192.168.226.245 192.168.226.81 192.168.226.189 192.168.226.191 192.168.226.197 192.168.226.215 192.168.226.246 192.168.226.15 192.168.226.20 192.168.226.22 192.168.226.62 192.168.226.69 192.168.226.77 192.168.226.85 192.168.226.128 192.168.226.184 192.168.226.203 192.168.226.232 192.168.226.241 192.168.226.109 192.168.226.139 192.168.226.181 192.168.226.235 192.168.226.182 192.168.226.121 192.168.226.193 192.168.226.38 192.168.226.148 192.168.226.154 192.168.226.239
LINODE_TOKEN="${LINODE_API_TOKEN}" ./bin/discover addrs provider=linode 0.08s user 0.04s system 2% cpu 4.498 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment