Open Source Supreme Monitor Based on GoLang

Overview

Open Source Supreme Monitor Based on GoLang

A module built for personal use but ended up being worthy to have it open sourced.

The module contains the following

- Ability to Add, Remove, View Keywords through HTTP requests to the server of your choice

- Ability to save item status in any database supported by GORM

- Efficient use of resources

The project is built on GoLang as I felt it was fit for it. Some parts that are really worth noting:

  • Stock Retriever
func GetStock(db *gorm.DB, jobs  chan <- Job){
	supremeData := make(chan Reply, 15)
	go StockRetriever(supremeData)
	for reply := range supremeData{
		keywords := database.GetKeywords(db)
		for _, category := range reply.ProductsAndCategories {
			for _, product := range category {
				if KeywordExistsInName(product.Name, keywords){
					jobs <- Job{id: product.ID, category: product.CategoryName, price: product.Price, itemName: product.Name}
				}
			}
		}

	}
}

This function is run as a goroutine, upon initialisation StockRetriever() is called as a goroutine and takes in supremeData which is a channel that gives back structs of type Reply and has a buffer of 15. Below we access the items from the supremeData channel and process them accordingly and sending them to the jobs channel as a Job structure for them to be handled individually.

  • Retrieving Individual Item Data
func getProductData(products chan <- SupremeItem, jobs <- chan Job){
	for job := range jobs{
		proxyUrl, err := url.Parse(getProxy())
		client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl)}}
		url := fmt.Sprintf("https://www.supremenewyork.com/shop/%d.json", job.id)
		r, err := client.Get(url)
		if err != nil {
			fmt.Println(err)
			continue
		}
		resp, _ := ioutil.ReadAll(r.Body)
		_ = r.Body.Close()
		var reply ItemResponse
		err = json.Unmarshal(resp, &reply)
		if err != nil {
			fmt.Println(err)
		}else {
			product := reply.Styles
			for _, p := range product {
				name := fmt.Sprintf("%s %s", job.itemName, p.Name)
				p.Color = p.Name
				p.Category = job.category
				p.Name = name
				products <- p
			}
		}
	}
}

This is the next part of the data, it takes in the structs from the jobs channel which are fed by the previous function, processes them and then feeds them back to the products channel which basically confirms whether an item is newly instock or out of stock and decides to send or skip the webhook.

Owner
SneakyKiwi
Go all the way ;)
SneakyKiwi
Go web monitor - A web monitor with golang

Step Download “go installer” and install on your machine. Open VPN. Go to “web-m

null 0 Jan 6, 2022
Gomon - Go language based system monitor

Copyright © 2021 The Gomon Project. Welcome to Gomon, the Go language based system monitor Welcome to Gomon, the Go language based system monitor Over

zosmac 1 Mar 21, 2022
Kubernetes monitor

模式说明 对应配置项为collect_mode cadvisor_plugin | kubelet_agent | server_side 三选一 代码为同一套代码 模式名称 部署运行方式 collect_mode配置 说明 夜莺插件形式采集cadvisor raw api 可执行的插件由夜莺age

null 43 Apr 9, 2022
MySQL Monitor Script

README.md Introduction mymon(MySQL-Monitor) 是Open-Falcon用来监控MySQL数据库运行状态的一个插件,采集包括global status, global variables, slave status以及innodb status等MySQL运行

Open-Falcon 259 May 10, 2022
Monitor your network and internet speed with Docker & Prometheus

Stand-up a Docker Prometheus stack containing Prometheus, Grafana with blackbox-exporter, and speedtest-exporter to collect and graph home Internet reliability and throughput.

Jeff Geerling 1.2k May 14, 2022
SigNoz helps developer monitor applications and troubleshoot problems in their deployed applications

SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. ?? ??

SigNoz 6.6k May 21, 2022
Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.

Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.

Hamed Yousefi 18 May 11, 2022
Hidra is a tool to monitor all of your services without making a mess.

hidra Don't lose your mind monitoring your services. Hidra lends you its head. ICMP If you want to use ICMP scenario, you should activate on your syst

null 6 Mar 9, 2022
Go Huobi Market Price Data Monitor

火币(Huobi)价格监控 由于部分交易对火币官方未提供价格监控,因此写了个小程序,长期屯币党可以用它来提醒各种现货价格。 该工具只需要提前安装Go环境和Redis即可。 消息推送使用的「钉钉」,需要提前配置好钉钉机器人(企业群类型、带webhook的机器人)。 使用方法 下载本项目 拷贝根目录下

ROC 2 Sep 24, 2021
Productivity analytics monitor 🧮

Productivity analytics monitor ??

John Forstmeier 0 Oct 8, 2021
Cloudprober is a monitoring software that makes it super-easy to monitor availability and performance of various components of your system.

Cloudprober is a monitoring software that makes it super-easy to monitor availability and performance of various components of your system. Cloudprobe

null 123 May 9, 2022
Monitor a process and trigger a notification.

noti Monitor a process and trigger a notification. Never sit and wait for some long-running process to finish. Noti can alert you when it's done. You

Jaime Piña 3.8k May 17, 2022
Monitor the performance of your Ethereum 2.0 staking pool.

eth-pools-metrics Monitor the performance of your Ethereum 2.0 staking pool. Just input the withdrawal credentials that were used in the deposit contr

Alvaro 6 May 3, 2022
Monitor & detect crashes in your Kubernetes(K8s) cluster

kwatch kwatch helps you monitor all changes in your Kubernetes(K8s) cluster, detects crashes in your running apps in realtime, and publishes notificat

Abdelrahman Ahmed 607 May 9, 2022
Fast, zero config web endpoint change monitor

web monitor fast, zero config web endpoint change monitor. for comparing responses, a selected list of http headers and the full response body is stor

Robin Verton 42 Apr 27, 2022
Monitor pipe progress via output to standard error.

Pipe Monitor Monitor pipe progress via output to standard error. Similar to functionality provided by the Pipe Viewer (pv) command, except this comman

SoftCoil Development 5 May 2, 2022
Open source framework for processing, monitoring, and alerting on time series data

Kapacitor Open source framework for processing, monitoring, and alerting on time series data Installation Kapacitor has two binaries: kapacitor – a CL

InfluxData 2.1k May 12, 2022
An Open Source video surveillance management system for people making this world a safer place.

Kerberos Open Source Docker Hub | Documentation | Website Kerberos Open source (v3) is a cutting edge video surveillance management system made availa

Kerberos.io 285 May 11, 2022
An open-source and enterprise-level monitoring system.

Falcon+ Documentations Usage Open-Falcon API Prerequisite Git >= 1.7.5 Go >= 1.6 Getting Started Docker Please refer to ./docker/README.md. Build from

Open-Falcon 6.9k May 10, 2022