This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! Utilities to work with metrics up for tests. | |
| use std::sync::atomic::Ordering; | |
| use eyre::{Result, eyre}; | |
| use metrics::{ | |
| Counter, Gauge, Histogram, Key, KeyName, Metadata, Recorder, SharedString, | |
| Unit, | |
| }; | |
| use metrics_util::registry::{AtomicStorage, Registry, Storage}; | |
| use tokio::time; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| loop { | |
| tokio::select! { | |
| _ = connect_retry.tick(), if connection.is_none() => { | |
| let Ok(conn) = endpoint.connect(self.reader_addr.clone(), reader::Sink::ALPN).await else { | |
| writer_log!(self, info, "connection failed"); | |
| metrics::counter!("writer.connect_failed").increment(1); | |
| continue; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let errors: Vec<kube::Error> = futures::stream::iter(crate::resources::all()) | |
| .map(|resource| async move { client.create(&PostParams::default(), &resource).await }) | |
| .buffered(100) | |
| .inspect(|result| { | |
| if let Ok(o) = result { | |
| info!(name = o.name_any(), "created CRD"); | |
| } | |
| }) | |
| .collect::<Vec<Result<CustomResourceDefinition, _>>>() | |
| .await |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let mut serializer = serde_yaml::Serializer::new(std::io::stdout()); | |
| for resource in resources::all() { | |
| resource.serialize(&mut serializer)?; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def my_func(foo, bar): | |
| def construct(fn): | |
| class Object: | |
| pass | |
| Object.foo = foo | |
| Object.bar = bar | |
| return Object | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub fn add(a: i32, b: i32) -> i32 { | |
| a + b | |
| } | |
| // This is a really bad adding function, its purpose is to fail in this | |
| // example. | |
| #[allow(dead_code)] | |
| fn bad_add(a: i32, b: i32) -> i32 { | |
| a - b | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[derive(Debug, Clone)] | |
| pub struct Client { | |
| service_url: url::Url, | |
| } | |
| impl Client { | |
| pub fn new(service_url: &str) -> Result<Self, Report> { | |
| let url = url::Url::parse(service_url)?; | |
| Ok(Self { service_url: url }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>KeepAlive</key> | |
| <true/> | |
| <key>Label</key> | |
| <string>com.openssh.ssh-agent-brew</string> | |
| <key>ProgramArguments</key> | |
| <array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -o errexit -o nounset -o pipefail | |
| cfg="${HOME}/.oprc" | |
| required_cfg=( | |
| 'OP_ADDRESS' | |
| 'OP_EMAIL' | |
| 'OP_ACCOUNT_KEY' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | |
| CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH)))) | |
| include $(CURRENT_DIR)/.env | |
| include $(CURRENT_DIR)/mk/dependency.mk | |
| include$(CURRENT_DIR)/mk/other.mk | |
| main: dependency-one other-two |
NewerOlder