twitter-archive/diffy là dự án Scala với 3.8k sao. Find potential bugs in your services with Diffy
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Twitter has decided to archive this project, as it was built on our outdated tech stack, making it unpractical to maintain it in its current form. Furthermore, we are reinventing in this space internally to accommodate newer use-cases for validating our services. As we mature these new approaches, we will reevaluate how and when to re-release these new solutions as open source software. Thank you for your understanding.
We won't be accepting pull requests or responding to issues for this project anymore.
Note that @puneetkhanduri, this project's original author and a former Twitter employee maintains their own version of this project, called Opendiffy.
Diffy
What is Diffy?
Diffy finds potential bugs in your service using running instances of your new code and your old
code side by side. Diffy behaves as a proxy and multicasts whatever requests it receives to each of
the running instances. It then compares the responses, and reports any regressions that may surface
from those comparisons. The premise for Diffy is that if two implementations of the service return
“similar” responses for a sufficiently large and diverse set of requests, then the two
implementations can be treated as equivalent and the newer implementation is regression-free.
For a more detailed analysis of Diffy checkout this blogpost.
How does Diffy work?
Diffy acts as a proxy that accepts requests drawn from any source that you provide and multicasts
each of those requests to three different service instances:
A candidate instance running your new code
A primary instance running your last known-good code
A secondary instance running the same known-good code as the primary instance
As Diffy receives a request, it is multicast and sent to your candidate, primary, and secondary
instances. When those services send responses back, Diffy compares those responses and looks for two
things:
Raw differences observed between the candidate and primary instances.
Non-deterministic noise observed between the primary and secondary instances. Since both of these
instances are running known-good code, you should expect responses to be in agreement. If not,
your service may have non-deterministic behavior, which is to be expected.
Diffy measures how often primary and secondary disagree with each other vs. how often primary and
candidate disagree with each other. If these measurements are roughly the same, then Diffy
determines that there is nothing wrong and that the error can be ignored.
How to get started?
Running the example
The example.sh script included here builds and launches example servers as well as a diffy instance. Verify
that the following ports are available (9000, 9100, 9200, 8880, 8881, & 8888) and run ./example/run.sh start.
Once your local Diffy instance is deployed, you send it a few requests
like curl --header "Canonical-Resource: Json" localhost:8880/json?Twitter. You can then go to your browser at
http://localhost:8888 to see what the differences across our example instances look like.
Digging deeper
That was cool but now you want to compare old and new versions of your own service. Here’s how you can
start using Diffy to compare three instances of your service:
Deploy your old code to localhost:9990. This is your primary.
Deploy your old code to localhost:9991. This is your secondary.
Deploy your new code to localhost:9992. This is your candidate.
Download the latest Diffy binary from maven central or build your own from the code using ./sbt assembly.
Run the Diffy jar with following command line arguments:
To build from source you can run docker build -t diffy .
FAQ's
For safety reasons POST, PUT, DELETE are ignored by default . Add -allowHttpSideEffects=true to your command line arguments to enable these verbs.
HTTPS
If you are trying to run Diffy over a HTTPS API, the config required is:
-service.protocol=https
And in case of the HTTPS port be different than 443:
-https.port=123
License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/twitter-archive/diffy là nguồn chính thức.
twitter-archive/diffy có bao nhiêu sao?
twitter-archive/diffy có 3.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/twitter-archive/diffy. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
twitter-archive/diffy có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho twitter-archive/diffy. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
twitter-archive/diffy có trang demo không?
Dự án có trang chủ ở https://twitter.com/diffyproject. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
twitter-archive/diffy còn đang phát triển không?
Commit gần nhất trên twitter-archive/diffy là 6.1 năm trước (theo timestamp GitHub). Repo có 360 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
twitter-archive/diffy dùng license gì?
twitter-archive/diffy phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
twitter-archive/diffy viết bằng ngôn ngữ gì?
twitter-archive/diffy chủ yếu viết bằng Scala. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về diffy?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về diffy.